You have been redirected from an outdated version of the article. Below is the content available on this topic. To view the old article click here.

include_child()

Usage

include_child(name)
include_child(name, collection, dataKey)

Description
Loads a template’s child element with the given name and renders its HTML representation into the output buffer. Nodes can be included via their name property. When used with an optional collection and data key argument, the included HTML element will be renderd as a Repeater Element.

Possible nodes MUST be unique in name. Works only in Template nodes.

Together with render()and include(), include_child() is one of the most important methods when dealing with HTML web templates since it allows the user to populate static HTML pages with dynamic content from the underlying node structure. See Page Rendering for more information on this topic.

Examples

${include_child('Child Node')}

will render the contents of the child node with the name “Child Node” into the output buffer.

${include_child('Item Template', find('Item'), 'item')}

will render the contents of the child node with the name “Item Template” repeatedly for every Item node in the database.

fig

Search results for "include_child()"

include_child()

Loads a template’s child element with the given name and renders its HTML representation into the output buffer. Nodes can be included via their name property. When used with an optional collection and data key argument, the included HTML element will be renderd as a Repeater Element.

Together with render()and include(), include_child() is one of the most important methods when dealing with HTML web templates since it allows the user to populate static HTML pages with dynamic content from the underlying node structure. See Page Rendering for more information on this topic.

include_child(name)
include_child(name, collection, dataKey)

Templates

Other than content elements, template elements can have child elements in the DOM tree which makes them very flexible. There are two special template expressions that help organizing the content rendering hierarchy: render() and include_child().