WebsiteBaker Support (2.8.x) > Templates, Menus & Design
ShowMenu2: Display root level page + child pages from any page
CodeALot:
I'm probably overlooking something but I can't find it:
I want to display a page-tree from a specific page (say PAGE_ID 5) and the child pages of that specific page.
I know about this solution:
--- Code: ---show_menu2(0, SM2_ROOT, SM2_ALL, SM2_ALL|SM2_CURRTREE);
--- End code ---
but that will only show the page tree of the page I am on at that moment.
What I want is: to show the pagetree of PAGE_ID 5 on any other page as well.
Any ideas?
nibz:
Maybe this works?:
--- Code: ---show_menu2(0, 5, SM2_ALL, SM2_ALL);
--- End code ---
Where 5 is the PAGE_ID of the page you want to use as root for the menu.
CodeALot:
--- Quote from: nibz on April 14, 2016, 02:18:45 PM ---Maybe this works?:
--- Code: ---show_menu2(0, 5, SM2_ALL, SM2_ALL);
--- End code ---
Where 5 is the PAGE_ID of the page you want to use as root for the menu.
--- End quote ---
Hi Nibz,
Well, that is a start since it shows all the child pages of page 5, but not page 5 itself :) But I could solve that with a second call of the menu, showing only root level. Thanks for getting me going again! :-)
jacobi22:
Do you mean a second menu?? if yes, use the page_id from your start-page instead of SM2_ROOT like this example here
549 is the id of my parent of this 3 subpages, here called as "CDs"
and the second menu is theresult of this menu call here
--- Code: ---<?php show_menu2(0, 549, SM2_ALL, SM2_ALL,'<li><span class="menu-default">[ac][menu_title]</a></span>','</li>','<ul>','</ul>');?>
--- End code ---
Upp, too late ;-)
CodeALot:
--- Quote from: jacobi22 on April 14, 2016, 02:29:45 PM ---Do you mean a second menu?? if yes, use the page_id from your start-page instead of SM2_ROOT like this example here
549 is the id of my parent of this 3 subpages, here called as "CDs"
and the second menu is theresult of this menu call here
--- Code: ---<?php show_menu2(0, 549, SM2_ALL, SM2_ALL,'<li><span class="menu-default">[ac][menu_title]</a></span>','</li>','<ul>','</ul>');?>
--- End code ---
Upp, too late ;-)
--- End quote ---
Help is never too late :)
What I mean is that I want to have a pagetree/menu displaying:
CD's
* CD 1
* CD2
* CD3
on *any* page. So just the pagetree of CD's, including the top level.
Navigation
[0] Message Index
[#] Next page
Go to full version