Class Summary HTML_Menu_SigmaTreeRenderer -- HTML_Template_Sigma-based renderer for 'tree' and 'sitemap' type menus, where menu level is represented by tag nesting.
Description
The renderer generates outpu similar to that of HTML_Menu_DirectTreeRenderer but offers more possibilites for output customization.
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 is the minimal template for HTML_Menu_SigmaTreeRenderer, containing all the required blocks:
<!-- BEGIN mu_tree_loop --> <!-- BEGIN mu_level_open --> <ul> <!-- END mu_level_open --> <!-- BEGIN mu_entry_open --> <li> <!-- END mu_entry_open --> <!-- BEGIN mu_active --> <strong>{mu_title}</strong> <!-- END mu_active --> <!-- BEGIN mu_inactive --> <a href="{mu_url}">{mu_title}</a> <!-- END mu_inactive --> <!-- BEGIN mu_activepath --> <a href="{mu_url}"><em>{mu_title}</em></a> <!-- END mu_activepath --> <!-- BEGIN mu_entry_close --> </li> <!-- END mu_entry_close --> <!-- BEGIN mu_level_close --> </ul> <!-- END mu_level_close --> <!-- END mu_tree_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.
Blocks in the template (without prefix)
tree_loop
This block should always be present and should be a parent for all other blocks. It is used to implement "flow", to render entries one after another.
level_open, level_close
These blocks will be used on start and end of each menu level. If level-specific blocks %level%_level_open and %level%_level_close are present, they will be used instead.
entry_open, entry_close
These blocks will be used on start and end of each menu entry. If level-specific blocks %level%_entry_open and %level%_entry_close are present, they will be used instead.
inactive, active, activepath
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. As usual, if other keys are present in original menu array they will be assigned to corresponding placeholders in the template.
If level-specific block %level%_%entry type% exists, it will be used instead.
Deliver First Class Web Sites: 101 Essential Checklists Want to learn how to make your web sites usable and accessible? Want to ensure that your sites meet current best practice, without spending hours trawling through incomprehensible specifications and recommendations from dozens of different books, research papers, and web sites? Want to make sure that the sites you build are "right the first time," requiring no costly redevelopments?