Is der anyway to sort the the results of nodes in ezflow manual blocks based on nodes attribute values

Author Message

Romeo Antony

Monday 04 October 2010 12:21:39 am

HI, anyone have an idea to sort the nodes in manual blocks based on nodes attribute values?

same question is here in the following thread .but solution is not the proper one. Can anyone help me out

http://share.ez.no/forums/extensions/ez-flow/control-the-order-of-items-in-manual-blocks#comment61980

Ivo Lukac

Monday 04 October 2010 4:02:07 am

If you want to automatically do something in block then it is not a manual block :)

Try making a custom block fetch class... Look in settings/block.ini and extension/ezflow/classes/fetches/* for examples

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Gaetano Giunta

Monday 04 October 2010 10:45:05 am

More: take care about the sorting of nodes in the results of your block fetch function: ezflow assumes items are to be sorted by the value of the 'ts_publication' value in the return array.

When this is not a publication date, things can get a little tricky, ie. you could use any ordered sequence of integers for sorting your items, but ezflow will still treat that value as a real timestamp, forgetting to update/show things with a date in the future, etc...

I've found the usage of custom blocks to be better: fetch and sort in the template, and you're done. Of course, this has an impact cache-wise.

Principal Consultant International Business
Member of the Community Project Board

Romeo Antony

Tuesday 05 October 2010 12:06:04 am

Thank you for your reply Gaetano,Ivo.

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 04:58:56
Script start
Timing: Jan 18 2025 04:58:56
Module start 'layout'
Timing: Jan 18 2025 04:58:56
Module start 'content'
Timing: Jan 18 2025 04:58:56
Module end 'content'
Timing: Jan 18 2025 04:58:56
Script end

Main resources:

Total runtime0.7183 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0068 588.6406152.7188
Module start 'layout' 0.00680.0035 741.359439.5938
Module start 'content' 0.01030.7066 780.9531596.2109
Module end 'content' 0.71680.0014 1,377.164112.0156
Script end 0.7182  1,389.1797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.5004160.0002
Check MTime0.00160.2249160.0001
Mysql Total
Database connection0.00100.137810.0010
Mysqli_queries0.645889.9059620.0104
Looping result0.00110.1545600.0000
Template Total0.680094.720.3400
Template load0.00190.260120.0009
Template processing0.678294.411720.3391
Template load and register function0.00010.014610.0001
states
state_id_array0.00110.157610.0011
state_identifier_array0.00140.201020.0007
Override
Cache load0.00150.2143190.0001
Sytem overhead
Fetch class attribute can translate value0.00150.211530.0005
Fetch class attribute name0.00160.219370.0002
XML
Image XML parsing0.00150.208630.0005
class_abstraction
Instantiating content class attribute0.00000.001880.0000
General
dbfile0.00560.7768290.0002
String conversion0.00000.001440.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
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs