Page 1 of 1

Menu Manager, how to display number of items (?)

Posted: Thu Aug 09, 2012 2:28 pm
by requish
Hello,

I cant find how to create {menu} which display only 4 items from long menu nodes.

Soo i have menu using

Code: Select all

{menu template="travels_cards_home_1" start_element="1.3.1" show_root_siblings="1"}
and this is display whole list of my menu. Option "Items="" " isnt good becouse it need enter page alias - better is use hierarchy numbers, but I cant - there no option to alow that. So, maybe there some modification in menu template to display only 4 first items at page?

Please help.

Cheers

Re: Menu Manager, how to display number of items (?)

Posted: Sat Aug 11, 2012 11:17 am
by requish
...anybody?

Re: Menu Manager, how to display number of items (?)

Posted: Sat Aug 11, 2012 11:57 am
by Jos
Best is to turn off "Show in Menu" in your page options.

Alternative is to add this code on top of your menu template

Code: Select all

{$nodelist=$nodelist|@array_slice:0:4}
note: this only works with CMSms 1.11 (smarty 3 required)

Re: Menu Manager, how to display number of items (?)

Posted: Sat Aug 11, 2012 12:08 pm
by requish
Thx for Yours reply!

"Show in menu" it is some solution, but how show all nodes in other subpage? Im want only 4 nodes at home, all entries on subpage.

Hmmm, there is no any option to enter into template?

Somewhere I found something like

Code: Select all

node->hierarchy < 4
but this doesnt work, or maybe I do some wrong...

Im using 1.10.3 of CMSMS, Im dont use 1.11 becouse supersizer dont work there, and much more modules.

Re: Menu Manager, how to display number of items (?)

Posted: Sat Aug 11, 2012 12:17 pm
by Jos
requish wrote:"Show in menu" it is some solution, but how show all nodes in other subpage? Im want only 4 nodes at home, all entries on subpage.
From the module-help:
(optional) show_all=1 - This option will cause the menu to show all nodes even if they are set to not show in the menu. It will still not display inactive pages however.
requish wrote:Im using 1.10.3 of CMSMS, Im dont use 1.11 becouse supersizer dont work there, and much more modules.
Don't ask me to look back to old versions. You can read my code as a hint and find out for yourself how to accomplish in Smarty2. Here's the documentation: http://www.smarty.net/docsv2/en/ ;)

Re: Menu Manager, how to display number of items (?)

Posted: Sat Aug 11, 2012 12:28 pm
by requish
Your solution works fine - so thanks for that simple idea :)

I'll use 1.11 in future - its sure, but first all modules,plugins have to works in it.

Thanks again!

Cheers

Re: Menu Manager, how to display number of items (?)

Posted: Sat Aug 11, 2012 12:38 pm
by Jos
requish wrote:I'll use 1.11 in future - its sure, but first all modules,plugins have to works in it.
Chances are that some of them never will :(

Re: Menu Manager, how to display number of items (?)

Posted: Sat Aug 11, 2012 7:58 pm
by Dr.CSS
I still don't understand why you didn't have just the pages you needed under Home, 4 is what you wanted, then any others that you don't want showing in the menu on there own or under a section header called Hidden that isn't shown in the menu...