This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Setup & design » fetch(content,search) with sort_by by...
expandshrink

fetch(content,search) with sort_by by multiple attributes

fetch(content,search) with sort_by by multiple attributes

Friday 01 September 2006 9:21:32 am - 1 reply

Hi
I have 9 classes: <b>C_1 (class_id=1)</b> , ... C_9 (class_id=9).
Let class C_i has some attributes <b>(a_i1, a_i2, ...)</b>
(C_1 -> a_11, a_12
C_2 -> a_21, a_22
etc.) and
<b>attribute_id of a_ij = ij</b> (ex. a_21 => attr_id=21)
(a_1j - name, text line; and a_2j - special category, text line or select)

I use fetch(content, search) with class_attribute_id as array, like:
{ ... class_attribute_id, array( a_11, a_21, ..., a_91 ) }
and it works (my post on http://ez.no/content/view/full/105218 )

But I want to use this fetch with sort_by too.
It works with { sort_by, array( 'name', false() ) }
but I hold out for this
{ sort_by, array( array( 'attribute', false(), ATTRIBUTE_IDs ) ) }
where ATTRIBUTE_IDs = { a_12, a_22, ..., a_92 }
like this pseudo-code:
{ sort_by, array( array( 'attribute', false(), <b>array( a_12, a_22, ..., a_92 )</b> ) ) }

And I think it is not possible, right?

I can fetch all search-nodes, and sort manualy, but it is not smart
So, is another way to sort in fetch?
Thank you.

Modified on Tuesday 12 September 2006 12:07:36 pm by Marcin Drozd

Tuesday 12 September 2006 12:16:11 pm

What I did:
- fetch all nodes (content,search)
- sort by extra attributes (one for one class)
- fetch only 10 specific nodes (from all sorted) and build navigation
but it's too slow
Do U have a better idea?

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from