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

eZ debug

Timing: Jan 18 2025 21:19:15
Script start
Timing: Jan 18 2025 21:19:15
Module start 'content'
Timing: Jan 18 2025 21:19:16
Module end 'content'
Timing: Jan 18 2025 21:19:16
Script end

Main resources:

Total runtime1.3342 sec
Peak memory usage4,096.0000 KB
Database Queries194

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0074 589.1563180.8359
Module start 'content' 0.00741.0978 769.9922536.6875
Module end 'content' 1.10520.2289 1,306.6797332.7813
Script end 1.3341  1,639.4609 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00470.3545210.0002
Check MTime0.00150.1126210.0001
Mysql Total
Database connection0.00080.059610.0008
Mysqli_queries1.252593.87951940.0065
Looping result0.00260.19161920.0000
Template Total1.296197.120.6481
Template load0.00180.133020.0009
Template processing1.294397.013720.6472
Template load and register function0.00030.019910.0003
states
state_id_array0.00150.111210.0015
state_identifier_array0.00360.270520.0018
Override
Cache load0.00150.1131230.0001
Sytem overhead
Fetch class attribute can translate value0.00120.088330.0004
Fetch class attribute name0.00110.085640.0003
XML
Image XML parsing0.00090.067530.0003
class_abstraction
Instantiating content class attribute0.00000.000940.0000
General
dbfile0.00330.2497270.0001
String conversion0.00000.000430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 13
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs