Sorting Articles

Author Message

Vivek Chopra

Thursday 18 March 2004 10:24:39 am

Is it possible to have a dropdown box on the site so that the user can select how he/she wants to sort the articles on the page?

I would prefer to have a dropdown box with class attributes to sort with.

Thanks
Vivek

Björn [email protected]

Friday 19 March 2004 12:34:09 am

How about you create a view for each sorting method?

this should work

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

Vivek Chopra

Friday 19 March 2004 10:31:17 am

I am not an eZpublish expert. Can you please explain a little more.

Thanks

Vivek

Balazs Halasy

Saturday 20 March 2004 9:01:53 am

You could create a form (with the dropwown in it) that is automatically posted every time the state of the dropdown is changed. Use Javascript to catch the event. In addition, use Javascript in order to post different values based on the different sorting selections. If you submit the data using the POST method then you'll have to extract it using the ezhttp template operator. If you're using the GET method then you'll have to incooperate the desired sorting method into the URL. This is possible by making use of the "view parameters" mechanism: http://www.example.com/your_page/(sort_method)/alphabetical. Extract the variable like this: "$view_parameters.sort_method". Based on the extracted variable you can then do different sortings in your fetch.

Balazs

Paul Borgermans

Saturday 20 March 2004 2:47:57 pm

Hi Balazs,

Isn't that functionality of 3.4 only? I would love to see it appear in 3.3-4 or so, this reduces the manual patching after an upgrade of 3.3-stable for me :-)

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Balazs Halasy

Saturday 20 March 2004 7:00:38 pm

Paul,

Which functionality do you mean? The extra view parameters are available in 3.3-3.

Balazs

Paul Borgermans

Sunday 21 March 2004 3:15:42 am

Hi Balazs,

I mean the custom template variable passing

like http://mysite/my/nice/url/(myvariable)/myvalue

I had to pull some files from the trunk to patch my 3.3-3 site for enabling this feature.

best regards

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Karsten Jennissen

Friday 26 March 2004 2:48:44 pm

Hi Balacz,

I tried this with 3.3-3 and it didn't work. Check: http://www.ez.no/community/bug_reports/view_parameters_only_works_with_offset

Paul,
any chance that you could help me backport this? I really need flexible view parameters with nice urls.

Karsten.

Vivek Chopra

Monday 10 May 2004 3:25:17 pm

I am using 3.3.4 and view_parameters don't work. Karsten, were you able to get this to work?

What files do I need to backport from 3.4 to make this work.

Thanks
Vivek

Vivek Chopra

Tuesday 18 May 2004 10:26:14 am

Paul,

Can you tell me what files did you backport to get the extra view_parameters working?

Thanks
Vivek

Paul Borgermans

Tuesday 18 May 2004 12:19:46 pm

These are the ones I copied from the trunk (the 3.4 beta should be fine)

     kernel/content/view.php
     index.php
     lib/ezutils/classes/ezmodule.php
     lib/ezutils/classes/ezuri.php 

hth

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Vivek Chopra

Friday 04 June 2004 3:17:05 pm

After importing files from the trunk, I don't get module not found error anymore. But still I don't get the view parameters.

I use the view parameters in my URL as

content/view/full/555/sort_method/city

After that I am printing all the view parameters by {$view_parameters|attribute(show)}

sort_method is not in the attribute list. Any ideas?

Vivek

Silke Fox

Monday 07 June 2004 6:43:10 am

Hi Vivek,

I think since 3.4 you have to use parentheses here.

Try
content/view/full/555/(sort_method)/city
it should be available as
{$view_parameters.sort_method}
then.

Silke

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