ShowMenu2: Display root level page + child pages from any page

sky writer

Good enough.  Maybe I did not understand your needs.  The solution I posted does this:
Quote from: CodeALot on April 14, 2016, 02:33:55 PM

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>');?>










Is that not what you needed?

CodeALot

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 :)


CodeALot


sky writer

I'm sure you got this figured out by now, but if not, I worked out a simple solution:
<?php show_menu2(089SM2_ALLSM2_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.

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
<?php show_menu2(0549SM2_ALLSM2_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.

Gast

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
<?php show_menu2(0549SM2_ALLSM2_ALL,'<li><span class="menu-default">[ac][menu_title]</a></span>','</li>','<ul>','</ul>');?>

Upp, too late  ;-)

CodeALot

Quote from: nibz on April 14, 2016, 02:18:45 PM
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! :-)

nibz

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.

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:
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?