Forums / Setup & design / Usage sort_by attribute on object_relation

Usage sort_by attribute on object_relation

Author Message

H-Works Agency

Wednesday 07 September 2005 7:54:40 am

Hi all

How can i use 'sort_by' mecanism during a content list fetch when i want to order the list according to an attribute that is an "object relation" list - list of objects of another class - The linked object class has a "name" attribute that i want to use to order ?

In human language : My product class has a "company" field linked to a list of companies. How can i order products according to its company name ?

Thanx for your help - Martin

EZP is Great

Gabriel Ambuehl

Wednesday 07 September 2005 11:07:03 am

Do some template code that fetches the data and sort it in place.

By default you can't sort relations for all I know.

Visit http://triligon.org

H-Works Agency

Saturday 10 September 2005 9:25:25 am

Ok thanx for your help - The problem is that it makes me double fetch the list...not very clean :\

Martin

EZP is Great