Hi everybody

 

I'm attempting to write a freemarker template for stages which checks if a
stage is defined for this page, and if not, tries to inherit the stage from
its parent page.

Standard inheritance (like it's default e.g. for footers) doesn't work for
me, because users should still be able to define different stages for
subpages if desired.

 

I already have a template that's working in Magnolia 4.4, but this is not
usable in 4.5 because of various changes in the templating API. So I tried
to adapt it to 4.5: I'm using the cmsfn.inherit() function to find parent
content and then access this content's stage, but I keep getting errors
(saying that it's not specified).

 

My Template:

 

<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 -->

 

 

Error Message:

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]

 

 

Sincerely

Cedric

 

 



----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to