Forums / Setup & design / order objects like i want? gna

order objects like i want? gna

Author Message

Yvan Cottyn

Wednesday 01 October 2003 2:54:06 am

Let's say that in folder XYZ i have 10 objects: A, B, C, D, E, F, G, H, I and J.
When looking at the folder (full view folder + list of children in line view) i want to see the children listed in following order: C, D, G, A, F, E, B, I, H, J.
This is not a logical order, not by pub/mod time, name, ..... but it is the order that i want. How do i fix that? What sort_by array do i feed to my fetch?

BTW, how do i set an object's priority and can i use sort by priority here?

TIA
Vanne

Paul Forsyth

Wednesday 01 October 2003 3:49:50 am

Do you want to sort in the template or in the admin interface?

For the admin interface you need to set the sort order for the folder itself. Once you have done this refresh the contents of the folder and you will see your sort happen.

For template sorting look here:

http://ez.no/content/view/full/29404

Paul

Yvan Cottyn

Wednesday 01 October 2003 5:51:14 am

thx for your reply but it does not answer my questions....
not the sorting question, not the priority thingy question....

Paul Forsyth

Wednesday 01 October 2003 7:43:02 am

You need to be more explicit with your questions and answer the questions asked of you.

I assume you are speaking about the admin? If you are in the admin edit the folder object you are interested in. In the edit view there is a drop-down box named 'Sort By'. You can select what order you wish there.

Paul

Mark Scarbrough

Wednesday 01 October 2003 12:57:23 pm

RE: BTW, how do i set an object's priority and can i use sort by priority here?

Yes, it sounds like the only way to get the custom sort order you want is to use priority sorting. As mentioned in previous posts, edit the parent object and set the sort order to 'priority'. Now navigate so that you are viewing (not editing) the parent object in the admin interface. You will see a list of the child objects in a table below the default view of the parent object. A user editable field of the table is labeled "priority". Type in the custom order in which you would like the objects to appear and then press the "update" button. It sounds complicated but it is easy after you do it once.

Now, the sort array to use in your in your template file:
To explicitly sort by priority: array('priority',true())
To respect the sort order set in the admin interface (which will be 'priority' if you follow the instructions above): $node.sort_array

Hope this helps,
Mark

Yvan Cottyn

Thursday 02 October 2003 6:37:45 am

okay,
i understand there is only a short fixed list of sorting criteria possible.
i also know how to change that for some object.
i understand that the 'priority' sorting option is the only one that can help me
to see my (child)objects listed in my custom order.

what i do not seem to find is how to set the priority for a certain (child)object.
can someone explain me how to do this:
in the root folder i have five other folders, nothing more. i want to set their priority value. how to?
it must be so simple i don't see it or something..

what's with the admin vs not admin thing? it's both template driven? i can overload them both, right?

blah
vanne

Mark Scarbrough

Thursday 02 October 2003 7:20:53 am

I tried to be as clear as possible in my previous post, and I would encourage you to follow it step by step:

1. Edit the root folder and set the "sort order" to priority.
2. Press "send for publishing".
3. You are probably now viewing (not editing!) the root folder in the admin interface. The child objects you wish to sort are listed on the screen below the default view of the root folder.
4. Take a close look at this list. Each object has a "priority" number which is user editable. Simply change the numbers to the order they should appear in and press "update".

Note, the priority number is not set when you edit an object, it is set from the list view. Also, the priority numbers do not appear unless you actually set the PARENT object sort order to priority.

Yvan Cottyn

Thursday 02 October 2003 8:35:16 am

aha, les voila!
i could kiss you :) gna

the problem was that i was looking to set priority values before setting the sort_by value of the parent node to 'priority' first... pffff

thx again