How to centralize a navigation function to be used by multiple page templates
Author: 00schmidt
Publication Date: 3/7/2011 11:05
In an existing project there are various page templates with the same navigation function.
<CMS_HEADER>
...
<CMS_FUNCTION name="Navigation" resultname="page_nav">
...
</CMS_FUNCTION>
...
</CMS_HEADER>
...
$CMS_VALUEpage_nav)$
...
What is to be done to centralize the navigation function to avoid redundant code and to access it by the templates with an adequate call?
Tags: template
-
Author: tomator - 3/8/2011 15:11
Instead of calling the $CMS_VALUE()$ inside the format template, add the attribute 'context="PAGE"' to your header function and add the corresponding $CMS_RENDER()$ statement to the output channel of your page template (as early as possible, ideally directly after the header declaration). The results of the header function are then set to your page context and can be individually called just as if the functions were defined in the header of the page template itself.
You can add several functions to one format template this way.
0
Please sign in to leave a comment.
Comments
1 comment