このページにステージが定義されているかどうかをチェックするステージ用の freemarker テンプレートを作成しようとしています。そうでない場合は、親ページからステージを継承しようとします。標準の継承 (フッターなどのデフォルトのように) は機能しません。ユーザーは、必要に応じてサブページのさまざまな段階を定義できるはずだからです。
Magnolia 4.4 で機能するテンプレートを既に持っていますが、テンプレート API のさまざまな変更により、これは 4.5 では使用できません。そこで、4.5 に適応させようとしました: cmsfn.inherit() 関数を使用して親コンテンツを検索し、このコンテンツのステージにアクセスしていますが、エラーが発生し続けます (指定されていないと言っています)。
私のテンプレート:
<div id="stage" style="color: white;">
[#if content??]
[@cms.component content=content /]
[#else]
[#assign inheritedContent = cmsfn.inherit(cmsfn.content(state.mainContent.@handle)) /]
[#if cmsfn.isEditMode()]
Inherited content: ${inheritedContent}
[/#if]
[@cms.component content=inheritedContent.stage /]
[/#if]
</div><!-- end stage -->
エラーメッセージ:
The 'content' parameter was passed but not or wrongly specified. The problematic instruction:
----------
==> user-directive cms.component [on line 17, column 17 in ***/pages/home/inheritStage.ftl]