Forums / Developer / Sorting Articles

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

eZ debug

Timing: Jan 30 2025 21:38:04
Script start
Timing: Jan 30 2025 21:38:04
Module start 'content'
Timing: Jan 30 2025 21:38:04
Module end 'content'
Timing: Jan 30 2025 21:38:04
Script end

Main resources:

Total runtime0.2024 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0089 587.8125370.3047
Module start 'content' 0.00890.0161 958.11721,013.6094
Module end 'content' 0.02510.1772 1,971.72663,901.6484
Script end 0.2023  5,873.3750 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00522.5477200.0003
Check MTime0.00160.7887200.0001
Mysql Total
Database connection0.00090.437810.0009
Mysqli_queries0.103851.27341410.0007
Looping result0.00140.71571390.0000
Template Total0.176787.310.1767
Template load0.00100.475910.0010
Template processing0.175886.856610.1758
Override
Cache load0.00060.314210.0006
Sytem overhead
Fetch class attribute can translate value0.00251.212310.0025
XML
Image XML parsing0.00030.143910.0003
General
dbfile0.00542.6628200.0003
String conversion0.00000.003430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs