WebsiteBaker Support (2.8.x) > Templates, Menus & Design
Inserting Headers in Menu
SnapDaddy:
Did some more work. The below example is if you only want a given root menus sub-menus to have headers. Other wise, use standard menu.
In my example, I have a root menu item called "Products" (page_id=2) that I wish to use the header text sub-menu.
index.php:
--- Code: ---<dl class="nav3-bullet">
<?php
$root_name = show_menu2(1, SM2_ROOT, SM2_START, SM2_ROOT|SM2_BUFFER,'[menu_title]', '', '', '');
if ($root_name=='Products') {// test for root menu Products
// header text menu - root+1 is header text
show_menu2(1, '2', SM2_ALL, SM2_ALL,'
[if(level<=1){<ul><li>[menu_title]}]
[if(level<=1){</li></ul>}]
[if(level>1){<dd>}]
[if(level==2){<dt>}]
[if(level>1){[a][menu_title]</a>}]
[if(level==2){</dt>}]
[if(level>1){</dd>}]
','','','');
} else {
//standard menu for all other root sub-menus
show_menu2(1, SM2_ROOT+1, SM2_CURR+1, SM2_TRIM,'[if(level>0){<dd>}][if(level==1){<dt>}][a][menu_title]</a>[if(level>0){</dd>}][if(level==1){</dt>}]');
}
?>
</dl>
--- End code ---
Navigation
[0] Message Index
[*] Previous page
Go to full version