Forums / Setup & design / Fetch reverse related objects and sort_by attribute

Fetch reverse related objects and sort_by attribute

Author Message

Ulrich L.

Monday 22 January 2007 2:58:05 pm

Hi,
as the documentation states: when using "fetch(content, reverse_related_objects...)" it is not possible to perform sort_by with the attribute parameter, as it is possible with "fetch(content, list, ...)"
This is really a pity! Does anybody have a good suggestion how to use "fetch(content, reverse_related_objects...)" AND to perform sorting by attribute in a different way?
I really need this...

Thanks,
Ulrich

eZ 3.8.5

Andreas Kaiser

Tuesday 23 January 2007 12:07:30 pm

I have some problems getting inside a template the nice url to a "related object" - and looking around I found these:

Perhaps these posts help you out:

http://ez.no/community/forum/general/object_relations

Perhaps this contribution helps:

http://ez.no/community/contribs/datatypes/enhanced_objectrelation

eZ Partner in Madrid (Spain)
Web: http://www.atela.net/

Ulrich L.

Wednesday 24 January 2007 6:35:31 am

Thanks.

I don't intend to join EOR since eZpublish manages to cover pretty much of that functionality out of the box today.

The forum thread is interesting. In the middle of it somebody explains that for sorting he creates a sort function, written in PHP and located in index.php.
Is this the only way to go for me, too?

Xavier Dutoit

Wednesday 24 January 2007 11:54:14 pm

Hi,

I suggest to create a custom sort template function (that could be used to sort any node/object table).

Eg :

{$unsorted_objects = fetch(content, reverse_related_objects...)
$sorted = {$unsorted|sort('your_attribute',true())}

X+

http://www.sydesy.com