Forums / Setup & design / Right Toolbar Sort Order

Right Toolbar Sort Order

Author Message

Gregory Mann

Thursday 14 April 2005 1:55:54 pm

Could anybody help me out here. I'd like to modify the code in the <i>node_list.tpl</i> so that it will order my entries in descending order instead of ascending order.
My challenge is to use a right toolbar as a quick view of upcoming events, but when I add an event, it shows up first in the list, instead of last.

Thanks
Greg

A child of five would understand this. Send someone to fetch a child of five.

Groucho Marx

Łukasz Serwatka

Friday 15 April 2005 7:10:52 am

Hi,

Look in to
design/standard/templates/toolbar/full/node_list.tpl

or to

design/standard/templates/toolbar/line/node_list.tpl

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Gregory Mann

Friday 15 April 2005 7:41:58 am

Thanks Lukasz
I know where to find the code, I just don't know how to write the code that I need so that the list will show up in descending order, rather than the default ascending order.

Heres the default code;

{* DO NOT EDIT THIS FILE! Use an override template instead. *}
<div class="toolbar-item {$placement}">
    {section show=or($show_subtree|count_chars()|eq(0), $requested_uri_string|begins_with( $show_subtree ))}
    {cache-block keys=$tool_id}
    {default limit=5}
    {section show=$sort_by|count|eq( 0 )}{set sort_by='published' }{/section}
    {let node_list=cond( $treelist_check|eq( 'yes' ),
                             fetch( content, tree, hash( parent_node_id, $parent_node,
                                    limit, $limit,
                                    class_filter_type, exclude,
                                    class_filter_array, array( 'folder' ),
                                    sort_by, array( $sort_by, false() ) ) ),
                         fetch( content, list, hash( parent_node_id, $parent_node,
                                limit, $limit,
                                class_filter_type, exclude,
                                class_filter_array, array( 'folder' ),
                                sort_by, array( $sort_by, false() ) ) ) )}
    <div class="toollist">
        <div class="toollist-design">
        <h2>{$title}</h2>gbm
        <div class="content-view-children">
        {section name=Node loop=$node_list sequence=array(bglight,bgdark)}
            {node_view_gui view=listitem content_node=$Node:item}
        {/section}
        </div>
        </div>
    </div>

    {/let}
    {/default}
    {/cache-block}
    {/section}
</div>

A child of five would understand this. Send someone to fetch a child of five.

Groucho Marx

Łukasz Serwatka

Friday 15 April 2005 3:09:42 pm

You will have to set sort_by array for fetch function.
http://ez.no/ez_publish/documentation/reference/data_fetching/content/list

Have you tried sort method in admin interface for your objects?

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

eZ debug

Timing: Jan 31 2025 06:12:19
Script start
Timing: Jan 31 2025 06:12:19
Module start 'content'
Timing: Jan 31 2025 06:12:19
Module end 'content'
Timing: Jan 31 2025 06:12:19
Script end

Main resources:

Total runtime0.1570 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 587.9297180.8359
Module start 'content' 0.00570.0066 768.765697.9922
Module end 'content' 0.01230.1446 866.7578526.2734
Script end 0.1569  1,393.0313 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00372.3394200.0002
Check MTime0.00150.9241200.0001
Mysql Total
Database connection0.00060.365610.0006
Mysqli_queries0.107268.28371410.0008
Looping result0.00120.75871390.0000
Template Total0.143991.710.1439
Template load0.00110.684110.0011
Template processing0.142991.018110.1429
Override
Cache load0.00070.466310.0007
Sytem overhead
Fetch class attribute can translate value0.00070.461310.0007
XML
Image XML parsing0.00020.153610.0002
General
dbfile0.01026.4832200.0005
String conversion0.00000.003230.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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs