WebsiteBaker Community Forum
WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: CodeALot on April 14, 2016, 02:01:58 PM
-
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:
show_menu2(0, SM2_ROOT, SM2_ALL, SM2_ALL|SM2_CURRTREE);
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?
-
Maybe this works?:
show_menu2(0, 5, SM2_ALL, SM2_ALL);
Where 5 is the PAGE_ID of the page you want to use as root for the menu.
-
Maybe this works?:
show_menu2(0, 5, SM2_ALL, SM2_ALL);
Where 5 is the PAGE_ID of the page you want to use as root for the menu.
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! :-)
-
Do you mean a second menu?? if yes, use the page_id from your start-page instead of SM2_ROOT like this example here
(https://i.gyazo.com/e3f4ac55dd6293d91f32140f71840c39.png)
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
<?php show_menu2(0, 549, SM2_ALL, SM2_ALL,'<li><span class="menu-default">[ac][menu_title]</a></span>','</li>','<ul>','</ul>');?>
Upp, too late ;-)
-
Do you mean a second menu?? if yes, use the page_id from your start-page instead of SM2_ROOT like this example here
(https://i.gyazo.com/e3f4ac55dd6293d91f32140f71840c39.png)
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
<?php show_menu2(0, 549, SM2_ALL, SM2_ALL,'<li><span class="menu-default">[ac][menu_title]</a></span>','</li>','<ul>','</ul>');?>
Upp, too late ;-)
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.
-
I'm sure you got this figured out by now, but if not, I worked out a simple solution:
<?php show_menu2(0, 89, SM2_ALL, SM2_ALL,'<li><span class="menu-default">[ac][menu_title]</a></span>','</li>','<ul>','</ul>');?>
The trick is, 89 is the id of an unused "hidden" (dummy) root parent page of "CDs". This way the child page "CDs" is shown, and then all children of the CDs page are shown as well.
Hope this helps.
-
Thanks, I'll give that one a try too :)
-
Did that solution work for you?
-
Unfortunately no. I ended up creating different menu-'numbers' for every pagetree and calling them using show_menu2(1 / show_menu2(2 / show_menu2(3 etc. etc.
For this project that worked well enough :)
-
Good enough. Maybe I did not understand your needs. The solution I posted does this:
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.
In this example, the hidden root page is id3:
<?php show_menu2(0, 3, SM2_ALL, SM2_ALL,'<li><span class="menu-default">[ac][menu_title]</a></span>','</li>','<ul>','</ul>');?>
(https://i.gyazo.com/7e45678890475eefa066449be11e5ade.png)
(https://i.gyazo.com/d4c5ab4c44808eeeda46b45a68887eab.png)
(https://i.gyazo.com/d7f103eb9bf199d770cde36f2c6e3b58.png)
Is that not what you needed?