Forums / Setup & design / Custom Sort Order of Menu Items

Custom Sort Order of Menu Items

Author Message

Gustave Stresen-Reuter

Tuesday 06 July 2004 6:03:24 am

Hi,

I'm new to eZ Publish so please forgive me if this is obvious...

I'm looking for a way, using the Admin interface, to set the display order of my main menu items (folders). Is this possible or is my only option to modify the template every time I modify the folders (main menu items)?

Example: I have four folders: Welcome, Resume, Profile, Articles. By default they display as Portfolio, Resume, Welcome, and Articles (probably because that was the order they were created in). How, using the Admin interface, can I change the display order?

Thanks in advance and I look forward to your replies.

Ted Stresen-Reuter

Alex Jones

Tuesday 06 July 2004 7:03:16 am

When using the Admin interface, edit the container folder that holds the objects that you want to re-order. Then choose to sort by <i>Priority</i>. Once you've saved the changes, you should see a new text field under the heading <i>Priority</i> next to each of the folders you mentioned. You can now set a specific order by numbering them in the order that you would like them to show up and clicking on <i>Update</i>.

Documentation: http://ez.no/ez_publish/documentation/day_to_day_use/sorting_content

Does that help?

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Gustave Stresen-Reuter

Tuesday 06 July 2004 7:49:35 am

That helped a lot and I actually even figured it out before I received your reply. However, I found that I had to set the sort in the template in order to get it to take. Specifically, I had to change:

{let children=fetch('content',list,hash(parent_node_id,2))}

to

{let children=fetch('content',list,hash(parent_node_id,2,'sort_by',array('priority',true())))}

That doesn't seem like the right approach, however, as the whole point of this system is to allow people to set such things as sort order without having to touch the code, no?

Any idea why I had to resort to modifying the template? I'm using eZ 3.2-6...

Ted