在Magnolia 4.5.3中,我試圖繼承父頁的階段,如果沒有爲此定義。 Java類TemplatingFunctions
(暴露在freemarker中cmsfn
)提供了一種方法inherit(Node content)
,所以我想以下幾點:cmsfn.inherit()似乎返回錯誤類型
[#if component??]
[@cms.component content=component /]
[#else]
[#assign inheritedContent = cmsfn.inherit(cmsfn.content([email protected])) /]
[@cms.component content=inheritedContent /]
[/#if]
但後來我得到一個錯誤:
The 'content' parameter must be a ContentMapModel and is a StringModel.
(6行我的例子)
爲什麼會發生這個錯誤,即我該如何解決這樣的錯誤?
是的,類型是其中一個問題,但我不得不使用'新的ContentMap(節點)'來使它工作。 –