Hi Bakers,
I would like to break up my menu list (showmenu2) with Text Headers. Is there a way to create these without having to use a bunch of multi menus?
Thanks
Hello,
make the text headers as parent pages and the other pages as subpages. Use the conditions of show_menu2 (look in readme.txt) to make the parent not as link and style them in your css.
Matthias
Thanks Matthias,
I know there was a way...
The current menu I have displays from the first sub-page down. I would like to have just the first sub-pages be the header text and anything below them be links.
You wouldn't happen to have any examples of how I would use conditions to do this?
OK, got it figured out! Thanks again!
:-D
Hi,
would you share your solution with the community?
Regards Bernd
Here is what I did. I am using a mod version of the Multiflex-3 template. The Multiflex-3 template uses multi menus and <dl> for the side menus.
My top nav (showmenu2 (0)) bar opens with only root menus. The side nav (showmenu2 (1))opens from first sub-menu down with the fist sub-menu being the header text.
It is important to note that if you have sub-menu items, the first sub-menu will be non-linking text (header text).
Menu level <= 1 becomes the header text wrapped in an unordered list for styling.
index.php template file:
<dl class="nav3-bullet">
<?php
show_menu2(1, SM2_ROOT+1, SM2_ALL, SM2_TRIM,'
[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>}]
','','','');?>
</dl>
Hope this helps!
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:
<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>