Include another template or some ancestor (recursion). |
|
| see name, with, zena 1.0 | |
The include tag has two different roles: pre-processing and recursion.
pre-processing
You can include sub-templates inside a given template and/or specialize some parts of the included template. Usually, you work by including “Node” template and specialize some parts to show a “Letter”, a “Project”, etc. Example:
<r:include template='Node'> <r:with part='title'/> <!-- remove title --> <r:with part='content'> ... specialize content view </r:with> </r:include>
You can also use it in a more traditional “partial” inclusion mechanism:
Include everything:
<r:include template='comments'/>
Or include just some part of a template:
<r:include template='Node' part='related'/>
See name for information on how to name parts.
recursion
If you include a “part” without specifying a template, the part is searched in the ancestors and produces recursion:
<r:void name='grp'> <r:parent> <r:include part='grp'/> / </r:parent> <r:show attr='title'/> </r:void>
The example above produces the following result (whitespace removed) when run from “status” :
Zena the wild CMS / projects list / Clean Water project / status title
You can augment the allowed recursion depth with depth parameter, but you won’t be allowed to go further then 30.