Class Summary HTML_Menu_SigmaRenderer – The renderer that uses HTML_Template_Sigma instance for menu output.
Description
This renderer uses HTML_Template_Sigma
for actual HTML generation. This will allow you to easily plug HTML_Menu into
your site's structure if you are using this template engine.
The renderer may also work with HTML_Template_IT
instance, but as menu templates tend to have lots of blocks, HTML_Template_Sigma's
cache feature will give
a significant performance improvement.
Template structure
This minimal template will allow output of any available menu type:
<!-- BEGIN mu_menu_loop --> <table cellpadding="2" cellspacing="0" border="1"> <!-- BEGIN mu_row_loop --> <tr> <!-- BEGIN mu_entry_loop --> <!-- BEGIN mu_inactive --> <td><!-- BEGIN mu_inactive_indent --> <!-- END mu_inactive_indent --><a href="{mu_url}">{mu_title}</a></td> <!-- END mu_inactive --> <!-- BEGIN mu_active --> <td><!-- BEGIN mu_active_indent --> <!-- END mu_active_indent --><strong>{mu_title}</strong></td> <!-- END mu_active --> <!-- BEGIN mu_activepath --> <td><!-- BEGIN mu_activepath_indent --> <!-- END mu_activepath_indent --><a href="{mu_url}"><strong>{mu_title}</strong></a></td> <!-- END mu_activepath --> <!-- BEGIN mu_previous --> <td><a href="{mu_url}"><<< {mu_title}</a></td> <!-- END mu_previous --> <!-- BEGIN mu_next --> <td><a href="{mu_url}">{mu_title} >>></a></td> <!-- END mu_next --> <!-- BEGIN mu_upper --> <td><a href="{mu_url}">^ {mu_title} ^</a></td> <!-- END mu_upper --> <!-- BEGIN mu_breadcrumb --> <td><a href="{mu_url}">{mu_title}</a> >>></td> <!-- END mu_breadcrumb --> <!-- END mu_entry_loop --> </tr> <!-- END mu_row_loop --> </table> <!-- END mu_menu_loop -->
A more complete example showing possible customizations can be found in the package archive.
Note that blocks and placeholders in the template have mu_ prefix.
This is done to prevent name conflicts with existing blocks and placeholders, mu_ is
the default prefix, another prefix can be passed to class constructor.
menu_loop
If present, this block will be parse()'d after outputting the current menu or (in case of 'rows' type) current menu level.
If menu type is 'rows' and %level%_menu_loop block is present, it will be parse()'d instead.
row_loop
If present, this block will be parse()'d after outputting the current menu row.
If menu type is 'rows' and %level%_row_loop block is present, it will be parse()'d instead.
entry_loop
This block should always be present and should be a parent for all menu entries' blocks. It is used to implement "flow", to render entries one after another.
If menu type is 'rows' and %level%_entry_loop block is present, it will be used instead.
These blocks are used to output menu entries, they correspond to possible entry types. Each block should contain a {title} placeholder and may also contain {url} placeholder and indent block
If menu type is either of 'tree', 'sitemap' or 'rows' and %level%_%entry type% block exists, it will be used instead.
inactive_indent, active_indent, activepath_indent
If present, these blocks are used to indent the entries inside tree-type menus ('tree' and 'sitemap').