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

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
User avatar
requish
Forum Members
Forum Members
Posts: 183
Joined: Sat Jan 24, 2009 3:12 pm

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

Post 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
User avatar
requish
Forum Members
Forum Members
Posts: 183
Joined: Sat Jan 24, 2009 3:12 pm

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

Post by requish »

...anybody?
Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

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

Post 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)
User avatar
requish
Forum Members
Forum Members
Posts: 183
Joined: Sat Jan 24, 2009 3:12 pm

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

Post 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.
Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

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

Post 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/ ;)
User avatar
requish
Forum Members
Forum Members
Posts: 183
Joined: Sat Jan 24, 2009 3:12 pm

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

Post 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
Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

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

Post 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 :(
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

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

Post 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...
Post Reply

Return to “CMSMS Core”