PHPLayers: Using a subset of content to do a menu

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
Post Reply
GarfielFr

PHPLayers: Using a subset of content to do a menu

Post 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 :)
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

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

Post 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!
jptechnical
Forum Members
Forum Members
Posts: 131
Joined: Wed Jan 12, 2005 12:18 am

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

Post 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!
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

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

Post by Ted »

Set collapse='1' in your bulletmenu definition.  That was added in 0.9.2.

Hope that helps.  :)
Post Reply

Return to “Tips and Tricks”