Page 1 of 1

PHPLayers: Using a subset of content to do a menu

Posted: Mon Mar 14, 2005 11:19 pm
by GarfielFr
If you have a hierarchie of content like this:

Code: Select all

1.      Content 1
1.1     Content 1.1
1.1.1   Content 1.1.1
1.1.2   Content 1.1.2
1.1.3   Content 1.1.3
1.2     Content 1.2
1.3     Content 1.3
2.      Content 2
2.1     Content 2.1
2.1.1   Content 2.1.1
2.1.2   Content 2.1.2
2.1.3   Content 2.1.3
2.2     Content 2.2
2.3     Content 2.3
And you want a menu (horizontal by example) with main menu like this:

Code: Select all

Content 1.1     Content 1.2      Content 1.3
use this code:

Code: Select all

{cms_module module='phplayers' horizontal="1" start_element="1."}
Look the point (.) after 1 in start_element !!! if you forgot it you will get the menu:

Code: Select all

Content 1
with content 1.x as popup-menu but not main menu

usefull if you want a multi langual site, you build 2 hirarchie of content, one "en" and another "fr" and you do 2 templates one for "en" and one for "fr" with just the start_element different.

I hope it's not a bug :)

Re: PHPLayers: Using a subset of content to do a menu

Posted: Tue Mar 15, 2005 2:55 am
by Ted
It's definatly a bug, but a useful one.  :)

I'm working on a show_root_siblings parameter for bulletmenu right now.  I'll port it over to phplayers as well.  Basically, you'll be able to get the same function you describe above with: {cms_module module='phplayers' horizontal="1" start_element="1.1" show_root_siblings="1"}

Your fix is less code, but not quite as user friendly.

Thanks!

Re: PHPLayers: Using a subset of content to do a menu

Posted: Tue Mar 15, 2005 3:23 am
by jptechnical
I know I asked this before but I can't remember. Does/will the new bullet menu have an argument so it knows where it is without specifying the start_element?

i.e. I would like a template to be used with many content items with 2 child objects each. I would like to put the bulletmenu in the template to show the current page and the child pages only. Since it is in a template it would need to be able to determine where it is in relation to the content item displayed.

That make sense?

Thanks Wishy... you have got a kick ass project here!

Re: PHPLayers: Using a subset of content to do a menu

Posted: Tue Mar 15, 2005 3:33 am
by Ted
Set collapse='1' in your bulletmenu definition.  That was added in 0.9.2.

Hope that helps.  :)