I can't sort by date

Author Message

Adolfo Barragán

Tuesday 07 October 2003 1:12:12 am

I'm trying fetch a list of classes and I need this list is sort by date (an attribute).

I put this code:

{let mylist=fetch('content',' list',
hash(parent_node_id, $node.node_id,
class_filter_type, include,
class_filter_array, array(18),
sort_by, array(array('attribute',false(),179))
))}

179 is the attribute Id for my ezdate field, but my list is unordered.

What's is wrong?

Regards
Adolfo Barragan

David Syers

Monday 13 October 2003 10:20:10 am

Hi Adolfo

Try:

{let mylist=fetch('content',' list',
hash(parent_node_id, $node.node_id,
class_filter_type, include,
class_filter_array, array(18),
sort_by, array('attribute',array(179,false()))
))}

or:

{let mylist=fetch('content',' list',
hash(parent_node_id, $node.node_id,
class_filter_type, include,
class_filter_array, array(18),
sort_by, array('class_identifier',array('your_ezdate_field_identifier',false()))
))}

Adolfo Barragán

Monday 13 October 2003 11:58:56 pm

I try both pieces of code, but none send me results.

Tony Wood

Friday 31 October 2003 8:55:26 am

I get this as well, I am on 3.2-3. Other sorted work fine, its just sort by a date doesn't work for me.

Tony

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

Alexandre Cunha

Wednesday 05 November 2003 10:33:08 am

How can i reverse order by date or other field ?

http://AlexandreCunha.com

Joris Lint

Thursday 06 November 2003 6:59:25 am

For reverse order, you can take a look at:
http://ezwiki.blanko.info/index.php/3XHT_FetchFunction

Tore Skobba

Thursday 18 December 2003 7:03:49 am

Hmm did anyone manage to solve this by the use of sorting at fetch? I did not and I am seeking for an solution. Currently I am using the "date" (datefield) as the name pattern and then sorting all objects on the name pattern.

UPDATE: I managed it now (sometimes I am bit to fast on the post button). Heres how I did it:

{let cal_list=fetch('content',list,
hash(parent_node_id, $node.node_id,
class_filter_type, include,class_filter_array, array(20),
sort_by,array('attribute',true(),175)))}

Where 175 is the id for the attribute which content is to be sorted on.

cheers
Tore

Adolfo Barragán

Friday 19 December 2003 12:22:49 am

> Currently I am using the "date" (datefield) as the
> name pattern and then sorting all objects on the
> name pattern.

But this is not a solution. My date field is not required, so I can use it for name.

Regards
Adolfo

Mike Borozdin

Sunday 21 December 2003 6:40:07 am

Hmm, eZ Publish keeps the date of posting an article somehow, but I don't know how. Do you know?

I think, if we knew how we could use its date field instead of creating our own field.

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 19:29:47
Script start
Timing: Jan 18 2025 19:29:47
Module start 'layout'
Timing: Jan 18 2025 19:29:47
Module start 'content'
Timing: Jan 18 2025 19:29:48
Module end 'content'
Timing: Jan 18 2025 19:29:48
Script end

Main resources:

Total runtime1.0474 sec
Peak memory usage4,096.0000 KB
Database Queries85

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 591.7109152.6094
Module start 'layout' 0.00650.0036 744.320339.4141
Module start 'content' 0.01011.0357 783.7344776.1797
Module end 'content' 1.04580.0016 1,559.914116.1875
Script end 1.0474  1,576.1016 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.3536160.0002
Check MTime0.00160.1520160.0001
Mysql Total
Database connection0.00120.116010.0012
Mysqli_queries0.975793.1544850.0115
Looping result0.00100.0944830.0000
Template Total1.011696.620.5058
Template load0.00220.205720.0011
Template processing1.009496.366420.5047
Template load and register function0.00010.013210.0001
states
state_id_array0.00080.072510.0008
state_identifier_array0.00220.209520.0011
Override
Cache load0.00190.1820620.0000
Sytem overhead
Fetch class attribute can translate value0.00130.120770.0002
Fetch class attribute name0.00190.1836100.0002
XML
Image XML parsing0.00100.099370.0001
class_abstraction
Instantiating content class attribute0.00000.0017100.0000
General
dbfile0.00080.0796160.0001
String conversion0.00000.001040.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
9content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
16content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
9content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 37
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs