Class Summary HTML_Menu_SigmaRenderer

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 offers more possibilites for output customization than HTML_Menu_DirectRenderer.

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 -->&nbsp;&nbsp;<!-- END mu_inactive_indent --><a href="{mu_url}">{mu_title}</a></td>
        <!-- END mu_inactive -->
        <!-- BEGIN mu_active -->
        <td><!-- BEGIN mu_active_indent -->&nbsp;&nbsp;<!-- END mu_active_indent --><strong>{mu_title}</strong></td>
        <!-- END mu_active -->
        <!-- BEGIN mu_activepath -->
        <td><!-- BEGIN mu_activepath_indent -->&nbsp;&nbsp;<!-- 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}">&lt;&lt;&lt; {mu_title}</a></td>
        <!-- END mu_previous -->
        <!-- BEGIN mu_next -->
        <td><a href="{mu_url}">{mu_title} &gt;&gt;&gt;</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> &gt;&gt;&gt;</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.

inactive, active, activepath, previous, next, upper, breadcrumb

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').

Class Trees for HTML_Menu_SigmaRenderer

HTML_Menu_SigmaRenderer Inherited Methods

Inherited from HTML_Menu_Renderer
Method Name Summary
HTML_Menu_Renderer::finishLevel() Finish the tree level (for types 'tree' and 'sitemap')
HTML_Menu_Renderer::finishMenu() Finish the menu
HTML_Menu_Renderer::finishRow() Finish the row in the menu
HTML_Menu_Renderer::renderEntry() Renders the element of the menu
HTML_Menu_Renderer::setMenuType() Sets the type of the menu being rendered.
returns the resultant array (Previous) Class constructor. (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.