Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 02:15:08 AM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155555 Posts in 21715 Topics by 7737 Members
Latest Member: gx-world
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Sub Menu  (Read 1983 times)
AddictedDesign

Offline Offline

Posts: 40



WWW
« on: March 24, 2007, 11:30:26 AM »

theres likely already a post about this, but, how would i call a second menu? the menu should only contain the sub pages of the main pages? i use show_menu2 and tried with this

                  <?php show_menu2(
        $aMenu          = 0,
        $aStart         = SM2_ROOT+1,
        $aMaxLevel      = SM2_CURR,
        $aFlags         = SM2_TRIM,
        ); ?>

but this doesnt seem to fetch anything up.

I noticed in the admin section under pages then settings of a page it asks which menu to use but it only has the one choice of main menu.?

my site is http://www.fresh-web-design.com

I want a simple text menu underneith the search bar where i can have pages for templates section, links and other stuff to sell.

I'v already created a page thats hidden and added sub pages to that
Logged

CUMBRIA WEB DESIGN - uk Web site designer + web programmer
frankyboy

Offline Offline

Posts: 113



WWW
« Reply #1 on: March 25, 2007, 10:46:40 PM »


I noticed in the admin section under pages then settings of a page it asks which menu to use but it only has the one choice of main menu.?


Thats just an option to add another menue to the page (you have to include it via adding the line "$menu[2]='secondmenu';" in info.php), this menu should be called with show_menu(2) in your index.php...
But I guess that was not what you tried to implement, right?
According to the documentation i would try it with
Code:
show_menu2(0, SM2_ROOT+1, SM2_START);
, just guessing wink
Logged

Disko-King.de
ruebenwurzel
WebsiteBaker Org e.V.

Offline Offline

Posts: 7973



WWW
« Reply #2 on: March 26, 2007, 07:38:49 AM »

Hello,

1. If you wanna use multiple menus with the standard "show_menu()" function you have to enable this in the advanced settings of WB, add the additional lini in info.php of your template, and call the menus in the index.php of your template with "show_menu(1)" and "show_menu(2)".

2. If you use the replacement menu function "show_menu2()", you don't need this changes in teh wb settings and the info.php as you can call this menu as many times as you want in your template. Wich menu shows wich pages can be defined only with the menu call. Look at the readme file wich comes with this modul.

Matthias
Logged
AddictedDesign

Offline Offline

Posts: 40



WWW
« Reply #3 on: March 26, 2007, 06:24:52 PM »

ive tried both these options and to no avail, i can get the father category but not the child categories,... theres something missing somewhere?Huh?

i have added the line to the info.php and now have the option in the pages sec to pic which menu
Logged

CUMBRIA WEB DESIGN - uk Web site designer + web programmer
ruebenwurzel
WebsiteBaker Org e.V.

Offline Offline

Posts: 7973



WWW
« Reply #4 on: March 26, 2007, 06:37:31 PM »

Hello,

only main Pages
<?php show_menu2(0, SM2_ROOT, SM2_CURR); ?>

all subpages without the main page
<?php show_menu2(0, SM2_ROOT+1, SM2_ALL); ?>

Please read the documentation

Matthias
Logged
AddictedDesign

Offline Offline

Posts: 40



WWW
« Reply #5 on: March 27, 2007, 09:18:01 AM »

I have read the docs, countless times which is why i have turned to the pro's.

A quick update,

I've tried <?php show_menu2(0, SM2_ROOT+1, SM2_ALL); ?>
but unfortunatly this done nothing.

I've now added <?php show_menu(2) ?> and defined the $menu in the info.php. So now i get the option of choosing which menu to put a page in.

This works great, BUT, when i go into one of the sub pages my main menu at the top is replaced by the sub menu.

I've left the links on the page for you to take a look at....... any help is much appreciated, as i say i have read and looked about the forum but unfortunatlly you's good people are my last choice.
Logged

CUMBRIA WEB DESIGN - uk Web site designer + web programmer
ruebenwurzel
WebsiteBaker Org e.V.

Offline Offline

Posts: 7973



WWW
« Reply #6 on: March 27, 2007, 09:51:51 AM »

Hello,

so how is the structure of your pages? Schould be:

Main Page1
    Subpage1.1
    Subpage1.2
    Subpage1.3
Main Page2
    Subpage2.1
    Subpage2.2
    ....

<?php show_menu2(0, SM2_ROOT, SM2_CURR); ?> shows
Main Page1
Main Page2
<?php show_menu2(0, SM2_ROOT+1, SM2_ALL); ?> shows only subpages f.e. if Main Page1 is active you got
Subpage1.1
Subpage1.2
Subpage1.3

Don't know what you do, is mysterious for me  wink

Matthias
Logged
AddictedDesign

Offline Offline

Posts: 40



WWW
« Reply #7 on: March 27, 2007, 10:28:04 AM »

Basically what i want is a second menu.

My pages at the moment are

menu 1
link1 link2 link3 link4

Then what i want is a completely different menu, a second one like
menu2
link1 link2 link3 link4

if you have a look at my page http://www.fresh-web-design.com you will see a link underneath the search that says sitemap.

this is part of the second menu, but when you click sitemap my main menu, menu1, dissapears


my menu1 uses show_menu2 the seconde menu with sitemap link uses show_menu
Logged

CUMBRIA WEB DESIGN - uk Web site designer + web programmer
ruebenwurzel
WebsiteBaker Org e.V.

Offline Offline

Posts: 7973



WWW
« Reply #8 on: March 27, 2007, 11:13:22 AM »

Hello,

Quote
my menu1 uses show_menu2 the seconde menu with sitemap link uses show_menu

Mixing the menu calls is possible but i recommand only to use one. You can use show_menu2 also with the multiple menu call parameters. So if i understand you correct your Sitestructure in WB is the following:

menu1
   link1
   link2
   link3
   link4
menu2
   link1
   link2
   link3
   link4

And you only wanna have displayed two menus with

link1
link2
link3
link4

without the menu1 or menu2 right?

Using show_menu2 do the following:
- add in info.php of the template:
     $menu[1]='firstmenu';   
     $menu[2]='secondmenu';
- add in the indes.php of your template
     <?php show_menu2(1, SM2_ROOT+1, SM2_ALL); ?>
     <?php show_menu2(2, SM2_ROOT+1, SM2_ALL); ?>
- define in WB admin the options of the pages the menu where the pages schould appear. Don't forget to set this for the main Pages too.

Matthias


Logged
AddictedDesign

Offline Offline

Posts: 40



WWW
« Reply #9 on: March 27, 2007, 01:57:23 PM »

Sorted, excellent help, i did the following.

Using show_menu2 do the following:
- add in info.php of the template:
     $menu[1]='firstmenu';   
     $menu[2]='secondmenu';

- add in the index.php of your template
     <?php show_menu2(1, SM2_ROOT, SM2_ALL); ?>
     <?php show_menu2(2, SM2_ROOT, SM2_ALL); ?>

- define in WB admin the options of the pages the menu where the pages schould appear. Don't forget to set this for the main Pages too.

Cheers Matthias

I was trying to use the two different menu funtions, which wb doesnt seem to like, show_menu on the same page as show_menu2.

Thanks all
Logged

CUMBRIA WEB DESIGN - uk Web site designer + web programmer
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!