WebsiteBaker Community Forum (upd)

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: SnapDaddy on July 10, 2009, 04:32:32 AM

Title: Inserting Headers in Menu
Post by: SnapDaddy on July 10, 2009, 04:32:32 AM
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
Title: Re: Inserting Headers in Menu
Post by: ruebenwurzel on July 10, 2009, 06:57:21 AM
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
Title: Re: Inserting Headers in Menu
Post by: SnapDaddy on July 10, 2009, 04:44:53 PM
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
Title: Re: Inserting Headers in Menu
Post by: BerndJM on July 10, 2009, 07:14:00 PM
Hi,

would you share your solution with the community?

Regards Bernd
Title: Re: Inserting Headers in Menu
Post by: SnapDaddy on July 11, 2009, 12:52:01 AM
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
(1SM2_ROOT+1SM2_ALLSM2_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!
Title: Re: Inserting Headers in Menu
Post by: SnapDaddy on July 11, 2009, 02:31:23 AM
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(1SM2_ROOTSM2_STARTSM2_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_ALLSM2_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(1SM2_ROOT+1SM2_CURR+1SM2_TRIM,'[if(level>0){<dd>}][if(level==1){<dt>}][a][menu_title]</a>[if(level>0){</dd>}][if(level==1){</dt>}]');
        }
    
?>


</dl>