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

eZ debug

Timing: Jan 31 2025 08:21:48
Script start
Timing: Jan 31 2025 08:21:48
Module start 'content'
Timing: Jan 31 2025 08:21:48
Module end 'content'
Timing: Jan 31 2025 08:21:49
Script end

Main resources:

Total runtime0.2095 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 589.0625180.8359
Module start 'content' 0.00640.0065 769.8984101.7578
Module end 'content' 0.01290.1964 871.6563530.5547
Script end 0.2094  1,402.2109 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00351.6682200.0002
Check MTime0.00150.7060200.0001
Mysql Total
Database connection0.00080.388110.0008
Mysqli_queries0.158875.82331410.0011
Looping result0.00120.56871390.0000
Template Total0.196293.710.1962
Template load0.00080.373810.0008
Template processing0.195493.278610.1954
Override
Cache load0.00060.264410.0006
Sytem overhead
Fetch class attribute can translate value0.00070.339910.0007
XML
Image XML parsing0.00020.117010.0002
General
dbfile0.01125.3323200.0006
String conversion0.00000.002830.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs