Anton,

Even though Radiant has evolved fairly quickly, the fact is that it is
a work in process which, in turn, means that many times people have to
hack their work-arounds to get stuff working the way they want. So, if
there's a specific task that you cannot concieveably accomplish with
existing tags, then you will HAVE TO write your own custom tags (i.e.
Ruby coding).

By field is meant a database field. Fields can also be though as the
columns in a database table. So, for example, you have a table with
the following structure:

id|name|children|parent

where id, name, children and parent are fields (columns).

Now let's say that you want to get all the list of children sorted
alphabetically, descending by name, you would write something like
(sql):

SELECT children FROM tablename ORDER BY name DESC;

or with the super easy Radius tags you would write something like

<r:children by="name" order="DESC">
#do stuff here ... useful stuff preferably
</r:children>


P.S.: someone please check this for accuracy as I have not slept a
wink in the last couple of days/nights.
On 1/26/07, Anton Aylward <[EMAIL PROTECTED]> wrote:
> 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
>
>
>
>
>
> _______________________________________________
> Radiant mailing list
> Post:   Radiant@lists.radiantcms.org
> Search: http://radiantcms.org/mailing-list/search/
> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
>
_______________________________________________
Radiant mailing list
Post:   Radiant@lists.radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to