Sort by attribute in several classes

Author Message

Anders F

Monday 12 January 2004 11:56:05 am

Is it possible in the current release (3.3.1) to sort by a class attribute name in several classes?

It's now possible to sort articles like this:

sort_by,array('attribute',false(), 'article/modified_date')

But can I sort a list of articles AND news_articles by the attribute modified_date?

James Packham

Tuesday 13 January 2004 4:08:52 am

Have you tried using a section to prepend/append one array to the other, then fetch and sort the contents? That's how I'd go about it. If I don't make much sense look at http://www.ez.no/developer/ez_publish_3/documentation/development/libraries/ez_template/operators/array_handling
and play with different ways of using the operators.

Regards,

~James~

Sujit Sth

Tuesday 04 January 2011 9:04:42 pm

Hi Andres,

Yes you can sort by class attribute. See the example below.

{def $rss=fetch('content','list', hash('parent_node_id',77, limit,6, sort_by, array( 'attribute', false(), 'rss_import/pubdate')))}

Here

rss_import -> class identifier
pubdate -> attribute identifier

for detail visit link

http://blog.developeronhire.com/index.php?s=sort

happy sorting

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 03:08:38
Script start
Timing: Jan 18 2025 03:08:38
Module start 'layout'
Timing: Jan 18 2025 03:08:38
Module start 'content'
Timing: Jan 18 2025 03:08:39
Module end 'content'
Timing: Jan 18 2025 03:08:39
Script end

Main resources:

Total runtime0.8840 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 588.0313152.6406
Module start 'layout' 0.00530.0027 740.671939.4766
Module start 'content' 0.00810.8745 780.1484542.0078
Module end 'content' 0.88260.0014 1,322.156312.1406
Script end 0.8840  1,334.2969 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00290.3242160.0002
Check MTime0.00120.1353160.0001
Mysql Total
Database connection0.00080.084810.0008
Mysqli_queries0.780288.2547590.0132
Looping result0.00060.0630570.0000
Template Total0.796890.120.3984
Template load0.00210.239420.0011
Template processing0.794689.888120.3973
Template load and register function0.00020.017510.0002
states
state_id_array0.00220.248310.0022
state_identifier_array0.00140.156820.0007
Override
Cache load0.00170.1893240.0001
Sytem overhead
Fetch class attribute can translate value0.00080.085230.0003
Fetch class attribute name0.00100.118650.0002
XML
Image XML parsing0.00220.251130.0007
class_abstraction
Instantiating content class attribute0.00000.001050.0000
General
dbfile0.00290.3273220.0001
String conversion0.00000.000840.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 13
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs