Forums / Setup & design / Right Toolbar Sort Order

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

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