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 Dieding@xrow.de

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.

eZ debug

Timing: Jan 18 2025 16:26:41
Script start
Timing: Jan 18 2025 16:26:41
Module start 'layout'
Timing: Jan 18 2025 16:26:41
Module start 'content'
Timing: Jan 18 2025 16:26:43
Module end 'content'
Timing: Jan 18 2025 16:26:43
Script end

Main resources:

Total runtime1.5479 sec
Peak memory usage4,096.0000 KB
Database Queries95

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0089 587.7969152.6094
Module start 'layout' 0.00890.0048 740.406339.4141
Module start 'content' 0.01371.5327 779.8203801.8359
Module end 'content' 1.54640.0014 1,581.656324.1875
Script end 1.5478  1,605.8438 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.2300160.0002
Check MTime0.00140.0886160.0001
Mysql Total
Database connection0.00110.069710.0011
Mysqli_queries1.454893.9842950.0153
Looping result0.00100.0640930.0000
Template Total1.509297.520.7546
Template load0.00230.148220.0011
Template processing1.506997.351620.7534
Template load and register function0.00030.017310.0003
states
state_id_array0.00090.059910.0009
state_identifier_array0.00160.102020.0008
Override
Cache load0.00210.1363750.0000
Sytem overhead
Fetch class attribute can translate value0.00060.035960.0001
Fetch class attribute name0.00170.1077160.0001
XML
Image XML parsing0.00190.123160.0003
class_abstraction
Instantiating content class attribute0.00000.0022190.0000
General
dbfile0.00110.0710290.0000
String conversion0.00000.000740.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
13content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
19content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.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/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.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: 46
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs