WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • Inserting Headers in Menu
  • Print
Pages: [1]   Go Down

Author Topic: Inserting Headers in Menu  (Read 5390 times)

Offline SnapDaddy

  • Posts: 44
Inserting Headers in Menu
« 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
Logged
Remember, experience is what you get when you don’t get what you want…

Offline ruebenwurzel

  • Betatester
  • **
  • Posts: 8544
  • Gender: Male
  • Keep on Rockin
    • Familie Gallas Online
Re: Inserting Headers in Menu
« Reply #1 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
Logged

Offline SnapDaddy

  • Posts: 44
Re: Inserting Headers in Menu
« Reply #2 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
« Last Edit: July 10, 2009, 06:02:29 PM by SnapDaddy »
Logged
Remember, experience is what you get when you don’t get what you want…

Offline BerndJM

  • Posts: 1764
  • Gender: Male
Re: Inserting Headers in Menu
« Reply #3 on: July 10, 2009, 07:14:00 PM »
Hi,

would you share your solution with the community?

Regards Bernd
Logged
In theory, there is no difference between theory and practice. But, in practice, there is.

Offline SnapDaddy

  • Posts: 44
Re: Inserting Headers in Menu
« Reply #4 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:

Code: [Select]
<dl class="nav3-bullet">

<?php

show_menu2
(1, SM2_ROOT+1, SM2_ALL, SM2_TRIM,&#39;
   
[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>}]
&
#39;,&#39;&#39;,&#39;&#39;,&#39;&#39;);?>

 
</dl>

Hope this helps!
Logged
Remember, experience is what you get when you don’t get what you want…

Offline SnapDaddy

  • Posts: 44
Re: Inserting Headers in Menu
« Reply #5 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:
Code: [Select]
<dl class="nav3-bullet">
    <?php
    $root_name 
= show_menu2(1, SM2_ROOT, SM2_START, SM2_ROOT|SM2_BUFFER,&#39;[menu_title]&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;);
    
if ($root_name==&#39;Products&#39;) {// test for root menu Products
    
                // header text menu - root+1 is header text
        
show_menu2(1, &#39;2&#39;, SM2_ALL, SM2_ALL,&#39;
        
[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>}]
            &
#39;,&#39;&#39;,&#39;&#39;,&#39;&#39;);
        
    
} else {
        
//standard menu for all other root sub-menus
        
show_menu2(1, SM2_ROOT+1, SM2_CURR+1, SM2_TRIM,&#39;[if(level>0){<dd>}][if(level==1){<dt>}][a][menu_title]</a>[if(level>0){</dd>}][if(level==1){</dt>}]&#39;);
        
}
    
?>


</dl>

Logged
Remember, experience is what you get when you don’t get what you want…

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • Inserting Headers in Menu
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2