A link how to sort on a page

A link how to sort on a page

Friday 06 April 2007 2:56:42 am - 1 reply

Author Message

Badii Bouteraa

Friday 06 April 2007 5:37:39 am

Hello!

I'm still a newbie in ez but I think that it will works like that

To classify the nodes you can put variables into the url and get them thanks to the $view_parameters function.

// template code

{def $var=false()}
{def $sorting='DESC'}

{if $view_parameters.sorting|eq('DESC')}
{set $var=true()}
{set $sorting='ASC'}
{else}
{set $var=false()}
{set $sorting='DESC'}
{/if}

{fetch( 'content', 'list', hash( 'parent_node_id', 42,
                                    'sort_by',
				     array( 'attribute', $var, 'data_name' )
			             ) )} 

// Link
<a href={concat($node.url_alias,"/(sorting)/",$sorting)|ezurl}>DESC</a>

Badi

You must be logged in to post messages in this topic!

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