[Radiant] Ordering of pages

Anton Aylward anton at si.on.ca
Fri Jan 26 07:36:51 CST 2007


Sean Cribbs said the following on 01/26/2007 08:08 AM:
> You can order by any field on the 'pages' table/ Page model.  

Right.
I see that in the documentation, but beyond 'title' and when it was
published, what constitutes a "field"?  I really don't want to pour
backwards and forwards though the code - this out to be documented!

Can the existence of a page part (the tab when editing like 'sidebar' or
'extended') or its content be used?  If I have one called 'current' can I
percolate that to the top?  If I have one called "order" in each of the
pages can I use its content to sort?

> Give the 
> 'order' attribute which direction you want to order it in ('asc'/'desc') 
> and the 'by' attribute the field you want to order on.

Yes, that asc/desc is clearly documented.  But the 'by' remains confusing.

> For your other situation, you'll probably have to create your own tag 
> definition (to order by something that's in a part/tab).  

In English, does that mean I have to write Ruby code to do this?

> There has been
> some work in the past on adding an arbitrary ordering to Radiant with 
> acts_as_list.  

I suspect you and I use the word 'arbitrary' slightly differently :-)
What I'm thinking of isn't at all arbitrary, its quite strictly controlled.
And I'm really surprised that better ordering of the children isn't an issue.

Of course I may just be completely misunderstanding what you mean by
'field'.  But as I say, it doesn't grab me in the documentation or the code
for <r:children:each>

I hope that there is something in there and Its just that I don't understand
what you mean by 'field'.

> If this is an increasingly requested feature and the
> implementation and case for it is solid, it might be added.  However, 
> features need to have a real pressing need before they are added, generally.

I do understand about time and resource constraints!  Oh boy, yes!

/a








More information about the Radiant mailing list