サンドボックスアプリケーションの開発 develop-sandbox-application
このセクションでは、テンプレートが 初期応用 セクション、および 初期コンテンツ 「 」セクションでは、アプリケーションを開発できます。 これを行うには、コミュニティコンポーネントを使用したオーサリングを有効にする機能を含む基盤スクリプトを使用します。 この節の最後に、完全に機能する Web サイトがあります。
Foundation ページスクリプトの使用 using-foundation-page-scripts
playpage テンプレートをレンダリングするコンポーネントを追加したときに作成されたデフォルトのスクリプトは、基盤ページの head.jsp とローカルの body.jsp を含むように変更されます。
スーパーリソースタイプ super-resource-type
最初の手順は、リソースのスーパータイププロパティを /apps/an-scf-sandbox/components/playpage
ノードを継承し、スーパータイプのスクリプトとプロパティを継承します。
使用中のCRXDE Lite:
-
ノードを選択
/apps/an-scf-sandbox/components/playpage
. -
「プロパティ」タブで、次の値を持つ新しいプロパティを入力します。
名前:
sling:resourceSuperType
タイプ:
String
値:
foundation/components/page
-
緑をクリック +追加 」ボタンをクリックします。
-
「すべて保存」をクリックします。
head および body スクリプト head-and-body-scripts
-
In CRXDE Lite エクスプローラペイン:に移動します。
/apps/an-scf-sandbox/components/playpage
をクリックし、ファイルをダブルクリックします。playpage.jsp
をクリックして、編集ウィンドウで開きます。/apps/an-scf-sandbox/components/playpage/playpage.jsp
code language-xml <%-- An SCF Sandbox Play Component component. This is the component which renders content for An SCF Sandbox page. --%><% %><%@include file="/libs/foundation/global.jsp"%><% %><%@page session="false" %><% %><% // TODO add your code here %>
-
開く/閉じるスクリプトタグに注意して、「 // TODO …」を
includes
頭部と体部の台本の <html>.のスーパータイプで
foundation/components/page
の場合、この同じフォルダーに定義されていないスクリプトは、/apps/foundation/components/page
フォルダー(存在する場合)、または内のスクリプトに/libs/foundation/components/page
フォルダー。/apps/an-scf-sandbox/components/playpage/playpage.jsp
code language-xml <%-- An SCF Sandbox Play Component component: playpage.jsp This is the component which renders content for An SCF Sandbox page. --%><% %><%@include file="/libs/foundation/global.jsp"%><% %><%@page session="false" %> <html> <cq:include script="head.jsp"/> <cq:include script="body.jsp"/> </html>
-
基盤スクリプトのオーバーレイ
head.jsp
は必要ではありませんが、基盤スクリプトは不要です。body.jsp
が空である。オーサリング用にを設定するには、オーバーレイ
body.jsp
ローカルスクリプトを使用し、本文に段落システム (parsys) を含めます。-
/apps/an-scf-sandbox/components
に移動します。 -
playpage
ノードを選択します。 -
右クリックして「 」を選択します。
Create > Create File...
- 名前: body.jsp
-
「すべて保存」をクリックします。
開く
/apps/an-scf-sandbox/components/playpage/body.jsp
次のテキストに貼り付けます。code language-xml <%-- An SCF Sandbox Play Component component: body.jsp This is the component which renders content for An SCF Sandbox page. --%><% %><%@include file="/libs/foundation/global.jsp"%><% %><%@page session="false" %> <body> <h2>Community Play</h2> <cq:include path="par" resourceType="foundation/components/parsys" /> </body>
-
-
「すべて保存」をクリックします。
ページを編集モードでブラウザーに表示します。
- 標準 UI:
http://localhost:4502/editor.html/content/an-scf-sandbox/en/play.html
見出しだけが表示されるわけではありません コミュニティの再生 をクリックします。また、ページコンテンツを編集するための UI も使用します。
アセット/コンポーネントのサイドパネルは、サイドパネルを開くように切り替えたときに表示され、ウィンドウの幅がサイドコンテンツとページコンテンツの両方に十分に広い場合に表示されます。
- クラシック UI:
http://localhost:4502/cf#/content/an-scf-sandbox/en/play.html
クラシック UI での再生ページの表示方法を次に示します ( コンテンツファインダー (cf) を含む )。
コミュニティコンポーネント communities-components
コミュニティコンポーネントのオーサリングを有効にするには、次の手順に従って開始します。
このサンドボックスの目的では、次のものから始めます。 Communities コンポーネント(チェックボックスをオンにして有効にします):
- コメント
- フォーラム
- レーティング
- レビュー
- レビューの概要 (表示)
- 投票
さらに、 一般 コンポーネント(例: )
- 画像
- テーブル
- テキスト
- タイトル (Foundation)
components
のプロパティ/etc/designs/an-scf-sandbox/jcr:content/playpage/par
.ランディングページ landing-page
多言語環境では、ルートページには、クライアントからの要求を解析して優先言語を決定するスクリプトを含めます。
この例では、ルートページは英語のページにリダイレクトするように静的に設定されています。英語のページは、今後、再生ページへのリンクを持つメインランディングページとして開発される可能性があります。
ブラウザー URL をルートページに変更します。 http://localhost:4502/editor.html/content/an-scf-sandbox.html
-
ページ情報アイコンを選択します。
-
選択 プロパティを開く
-
「詳細」タブで、
- リダイレクトエントリの場合は、 Web サイト > SCF サンドボックスサイト > SCF サンドボックス
- クリック OK
-
クリック OK
サイトが公開された後、パブリッシュインスタンス上のルートページを参照すると、英語のページにリダイレクトされます。
コミュニティ SCF コンポーネントを再生する前の最後の手順は、クライアントライブラリフォルダー (clientlibs) を追加することです… clientlibs を追加