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

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.