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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 00:24:13
Script start
Timing: Jan 19 2025 00:24:13
Module start 'layout'
Timing: Jan 19 2025 00:24:13
Module start 'content'
Timing: Jan 19 2025 00:24:15
Module end 'content'
Timing: Jan 19 2025 00:24:15
Script end

Main resources:

Total runtime1.3618 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0083 587.9141152.6250
Module start 'layout' 0.00830.0062 740.539139.4609
Module start 'content' 0.01451.3458 780.0000531.6094
Module end 'content' 1.36030.0015 1,311.609412.1641
Script end 1.3617  1,323.7734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00380.2802160.0002
Check MTime0.00160.1144160.0001
Mysql Total
Database connection0.00090.067110.0009
Mysqli_queries1.309196.1324570.0230
Looping result0.00060.0435550.0000
Template Total1.313096.420.6565
Template load0.00240.177120.0012
Template processing1.310596.238020.6553
Template load and register function0.00030.022610.0003
states
state_id_array0.00150.108010.0015
state_identifier_array0.00390.283920.0019
Override
Cache load0.00200.1497230.0001
Sytem overhead
Fetch class attribute can translate value0.00100.075220.0005
Fetch class attribute name0.00180.133340.0005
XML
Image XML parsing0.00060.046920.0003
class_abstraction
Instantiating content class attribute0.00000.000740.0000
General
dbfile0.00080.0601160.0001
String conversion0.00000.000940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 13
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs