Components are combined ITL/HTML/CSS blocks that produce certain output. That output is then fitted into template placeholders. Note that one placeholder can contain output of multiple components (including the same component multiple times), and that this work of loading, evaluating and fitting components into the template is carried out by the tag.
Here's an example of a component hello_world
and
a page that uses it, based on the above template:
Component saved in file components/hello_world
:
Hello, World! The time is [time]
WellWell page saved in pages/test.itl
:
[compose template=simple components.body="hello_world" skip_auto_components=1 ]
Final HTML output:
<html> <head> </head> <body> Hello, World! The time is Wed Oct 7 12:12:25 2009. </body> </html>
As said, it is possible to specify default components that will be
placed in containers, along with their corresponding options.
The definitions are passed via MV_COMPONENT_AUTO
and MV_ATTRIBUTE_AUTO
. Example:
Variable MV_COMPONENT_AUTO <<EOD htmlhead:htmlhead left:menu,categorynav body:infobox EOD Variable MV_ATTRIBUTE_AUTO <<EOD menu.name=main EOD
The default components are always inserted, because a manual setting of
components.
within pages only appends the list.
So to skip insertion of some of the default components, you can use
attribute PLACEHOLDER
=...skip_auto_components=
. It can contain
names of the components to skip, or "1" to skip all default components.
Many more options are supported — for a full reference, see tag .