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

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 18 2025 22:20:14
Script start
Timing: Jan 18 2025 22:20:14
Module start 'layout'
Timing: Jan 18 2025 22:20:14
Module start 'content'
Timing: Jan 18 2025 22:20:16
Module end 'content'
Timing: Jan 18 2025 22:20:16
Script end

Main resources:

Total runtime1.1955 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0050 587.9141152.6250
Module start 'layout' 0.00510.0024 740.539139.4453
Module start 'content' 0.00751.1866 779.9844562.1563
Module end 'content' 1.19410.0014 1,342.140616.1641
Script end 1.1955  1,358.3047 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.2598160.0002
Check MTime0.00130.1094160.0001
Mysql Total
Database connection0.00070.055710.0007
Mysqli_queries1.132194.6981600.0189
Looping result0.00080.0662580.0000
Template Total1.166697.620.5833
Template load0.00190.162520.0010
Template processing1.164797.419320.5823
Template load and register function0.00010.009510.0001
states
state_id_array0.00100.083910.0010
state_identifier_array0.00120.102820.0006
Override
Cache load0.00170.1462260.0001
Sytem overhead
Fetch class attribute can translate value0.00060.054020.0003
Fetch class attribute name0.00190.156960.0003
XML
Image XML parsing0.00110.095720.0006
class_abstraction
Instantiating content class attribute0.00000.002280.0000
General
dbfile0.00110.0928240.0000
String conversion0.00000.000640.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
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/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: 22
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs