WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: netash on February 17, 2012, 08:07:56 AM

Title: Showmenu2 vertical menu under specific page
Post by: netash on February 17, 2012, 08:07:56 AM
Hallo friends,

I have a multilang template with one menu shows in two ways:
1. normal dropdown menu.
2. side menu only for a part of the tree - products.

The tree looks like:
-EN
--Home
--About
--Products
---group1
----product1
----product2
---group2
----product3
----product4
-DE

My problem is with the side menu.
I am using this code:
Code: [Select]
<?php show_menu2(075SM2_CURR+1SM2_ALL SM2_TRIM'<li><a href="[url]" class="[class]"><span>[menu_title]</span></a>''</li>''<ul class="ullev[level]">''</ul>'falsefalse);?>75 is the page number of "Products" that the I want to show the menu items under.
When group1 is pressed, I want to see its childs - product 1 and 2, and group2 without its childs.
It is all working fine when I am in the "product" tree, but when I press "home" or "about", no items are shown in the side menu.

Please Help,
Thanks,
Netash
Title: Re: Showmenu2 vertical menu under specific page
Post by: mdemaree99 on February 21, 2012, 08:52:04 PM
Try this
Code: [Select]
show_menu2(0, SM2_ROOT+1,SM2_ALL , SM2_ALL|SM2_CURRTREE
I have never tried or seen an example of putting a page number as an option, so a little surprised it is working at all.  In your code...I looks like that when you click on Home.. The start would equal the aMaxLevel

show_menu2(
        $aMenu          = 0,
        $aStart         = SM2_ROOT,
        $aMaxLevel      = SM2_CURR+1,
        $aOptions       = SM2_TRIM,

I am doing a site like that that I have used 3 menus to help out.

Top: (Shows my Public and Member Section)  Would show different languages for you
show_menu2(0, SM2_ROOT, SM2_START, SM2_ALL

Main:  Shows dropdown menu to all sites within my Public or Members section
show_menu2(0, SM2_ROOT+1, SM2_ALL, SM2_ALL|SM2_CURRTREE

Side Menu:  (shows one level down of sub pages.
show_menu2(0, SM2_CURR+2, SM2_CURR+2,SM2_ALL|SM2_CURRTREE

SM2_CURRTREE ensures I am not showing my public pages when I am in members.
Would not see members side in public unless user had already logged in.  Can make output pretty ugly.

examples page should help
http://www.websitebakers.de/sm2/pages/enterprise.php (http://www.websitebakers.de/sm2/pages/enterprise.php)
Title: Re: Showmenu2 vertical menu under specific page
Post by: mdemaree99 on February 22, 2012, 07:24:05 AM
Also see another thread.
https://forum.WebsiteBaker.org/index.php/topic,22455.msg158715.html#msg158715

Are you 2 the same user??