テーマにレイアウトテンプレートを含める
ご覧のページは、お客様の利便性のために一部機械翻訳されています。また、ドキュメントは頻繁に更新が加えられており、翻訳は未完成の部分が含まれることをご了承ください。最新情報は都度公開されておりますため、必ず英語版をご参照ください。翻訳に問題がある場合は、こちらまでご連絡ください。
レイアウトテンプレートは単独でデプロイできますが、テーマにバンドルすることもできます。 テーマにレイアウトテンプレートを含めるには、次の手順を実行します。
-
テーマの
liferay-look-and-feel.xml
ファイルを開き、<theme>...</theme>
タグの間に<layout-templates>
タグをネストして、以下の構成に一致するようにします。<theme id="my-theme-name" name="My Theme Name"> ... <layout-templates> <custom> //layout template code goes here </custom> </layout-templates> ... </theme>
-
<layout-template>
タグを使用して、<custom>...</custom>
タグの間にレイアウトテンプレートを配置します。<layout-template>
タグのid
属性 は、レイアウトテンプレートのファイル名 一致する必要があります。 以下に設定例を示します。<layout-template id="my_liferay_layout_template" name="My Liferay Layout Template">
-
以下に示すように、
<template-path>
タグでレイアウトテンプレートのパスを指定します。<template-path> /layoutttpl/custom/my_liferay_layout_template.ftl </template-path>
-
以下に示すように、
<thumbnail-path>
タグで レイアウトテンプレートサムネイルの パスを指定します。<thumbnail-path> /layoutttpl/custom/my_liferay_layout_template.png </thumbnail-path>
-
完成したレイアウトをテーマの
src / layouttpl
フォルダーに配置します。 以下は、liferay-look-and-feel
構成の例です。… /layoutttpl/custom/my_liferay_layout_template.ftl /layoutttpl/custom/my_liferay_layout_template.png
これで、レイアウトテンプレートをLiferay DXPテーマに含める方法がわかりました!