Page 1 of 1

excludeprefix and includeprefix

Posted: Wed Oct 26, 2011 8:04 am
by georgechr
Dont know if this is the right place to answer, please move it to the according one if not.

Well i have a site with 3 menus. Each of the menus has children.
The only way i managed to make it work is using the excludeprefix like below:

Code: Select all

{menu template="CSSMENU_DEFAULT_HORIZONTAL" start_level="2" excludeprefix="diethneis_sxeseis,ekdilwseis,koinwniki_allilegii,
announcements,useful_links,members_area"}

{menu template="CSSMENU_DEFAULT_HORIZONTAL_2" start_level="2" excludeprefix="o_tektonismos,megali_stoa,diethneis_sxeseis,ekdilwseis,
koinwniki_allilegii,announcements,useful_links,contact,register"}

{menu template="CSSMENU_DEFAULT_VERTICAL" start_level="2" excludeprefix="o_tektonismos,megali_stoa,contact,
members_area,register"}
My problem though is that this means that everytime i add a new link i will have to go manually and edit all my templates. All of my menus have children therefore i need something that will only show some items with their children

I tried using includeprefix to show only what i wanted, but it does not show children.

What is the way to go for this?

Thanks in advance

Re: excludeprefix and includeprefix

Posted: Wed Oct 26, 2011 11:48 am
by spcherub
It is hard to respond to your question without knowing how your pages are structured (page hierarchy in the admin tool) and how the menus need to be rendered on the public facing page.

Have you looked into the "number_of_levels" parameter of the {menu} tag? This allow you to limited the number of levels that are exposed via that call.

-S

Re: excludeprefix and includeprefix

Posted: Wed Oct 26, 2011 2:07 pm
by georgechr
this is how my hierarchy goes.

Image

So if i create another language for my site it will be number 2 etc.

i am using number of levels to not show the home page.

Re: excludeprefix and includeprefix

Posted: Wed Oct 26, 2011 2:32 pm
by staartmees
you can use the includeprefix if you manually change the page-alias of each page. The pages which belong in the first menu all get a page-alias that starts with m1- , the second menu m2- and the third menu with m3-

Code: Select all

{menu template="CSSMENU_DEFAULT_HORIZONTAL" start_level="2" includeprefix="m1-"}

{menu template="CSSMENU_DEFAULT_HORIZONTAL_2" start_level="2" includeprefix="m2-"}

{menu template="CSSMENU_DEFAULT_VERTICAL" start_level="2" includeprefix="m3-"}



Re: excludeprefix and includeprefix

Posted: Thu Oct 27, 2011 6:14 am
by georgechr
it worked!!

Thanks a million. You saved me from weeks of trying :)