このセクションでは、テンプレートが 初期応用 セクション、および 初期コンテンツ 「 」セクションでは、アプリケーションを開発できます。 これを行うには、コミュニティコンポーネントを使用したオーサリングを有効にする機能を含む基盤スクリプトを使用します。 この節の最後に、完全に機能する Web サイトがあります。
playpage テンプレートをレンダリングするコンポーネントを追加したときに作成されたデフォルトのスクリプトは、基盤ページの head.jsp とローカルの body.jsp を含むように変更されます。
最初の手順は、リソースのスーパータイププロパティを /apps/an-scf-sandbox/components/playpage
ノードを継承し、スーパータイプのスクリプトとプロパティを継承します。
CRXDE Lite の使用:
ノードを選択 /apps/an-scf-sandbox/components/playpage
.
「プロパティ」タブで、次の値を持つ新しいプロパティを入力します。
名前:sling:resourceSuperType
タイプ:String
値:foundation/components/page
緑をクリック +追加 」ボタンをクリックします。
「すべて保存」をクリックします。
In CRXDE Lite エクスプローラペイン:に移動します。 /apps/an-scf-sandbox/components/playpage
をクリックし、ファイルをダブルクリックします。 playpage.jsp
をクリックして、編集ウィンドウで開きます。
/apps/an-scf-sandbox/components/playpage/playpage.jsp
<%--
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
<%--
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...
「すべて保存」をクリックします。
開く /apps/an-scf-sandbox/components/playpage/body.jsp
次のテキストに貼り付けます。
<%--
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>
「すべて保存」をクリックします。
ページを編集モードでブラウザーに表示します。
http://localhost:4502/editor.html/content/an-scf-sandbox/en/play.html
見出しだけが表示されるわけではありません コミュニティの再生をクリックします。また、ページコンテンツを編集するための UI も使用します。
アセット/コンポーネントのサイドパネルは、サイドパネルを開くように切り替えたときに表示され、ウィンドウの幅がサイドコンテンツとページコンテンツの両方に十分に広い場合に表示されます。
http://localhost:4502/cf#/content/an-scf-sandbox/en/play.html
クラシック UI での再生ページの表示方法を次に示します ( コンテンツファインダー (cf) を含む )。
コミュニティコンポーネントのオーサリングを有効にするには、次の手順に従って開始します。
このサンドボックスの目的では、次のものから始めます。 Communities コンポーネント(チェックボックスをオンにして有効にします):
さらに、 一般 コンポーネント(例: )
ページパーツに対して有効なコンポーネントは、 components
のプロパティ
ノード /etc/designs/an-scf-sandbox/jcr:content/playpage/par
.
多言語環境では、ルートページには、クライアントからの要求を解析して優先言語を決定するスクリプトを含めます。
この例では、ルートページは英語のページにリダイレクトするように静的に設定されています。英語のページは、今後、再生ページへのリンクを持つメインランディングページとして開発される可能性があります。
ブラウザー URL をルートページに変更します。 http://localhost:4502/editor.html/content/an-scf-sandbox.html
ページ情報アイコンを選択します。
選択 プロパティを開く
「詳細」タブで、
クリック OK
サイトが公開された後、パブリッシュインスタンス上のルートページを参照すると、英語のページにリダイレクトされます。
コミュニティ SCF コンポーネントを再生する前の最後の手順は、クライアントライブラリフォルダー (clientlibs) を追加することです… clientlib の追加