# Order by date for archive page types

**URL:** <https://www.ruby-forum.com/t/order-by-date-for-archive-page-types/134687>\
**Category:** Radiant CMS\
**Created:** [April 14, 2008, 3:40am UTC](https://www.ruby-forum.com/t/order-by-date-for-archive-page-types/134687 "2008-04-14T03:40:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![imakethings](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ce7236/32.png) [@imakethings](https://www.ruby-forum.com/u/imakethings)\
**Post date:** [April 14, 2008, 3:40am UTC](https://www.ruby-forum.com/t/order-by-date-for-archive-page-types/134687/1 "2008-04-14T03:40:33Z")

</div>

Is there a way to order child pages of an archive page type by the  
publish date? Its currently ordered alphabetically.

---

<div class="post-metadata">

**Author:** ![imakethings](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ce7236/32.png) [@imakethings](https://www.ruby-forum.com/u/imakethings)\
**Post date:** [April 14, 2008, 4:53am UTC](https://www.ruby-forum.com/t/order-by-date-for-archive-page-types/134687/2 "2008-04-14T04:53:33Z")

</div>

And I mean the list of pages in the admin interface…

---

<div class="post-metadata">

**Author:** ![imakethings](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ce7236/32.png) [@imakethings](https://www.ruby-forum.com/u/imakethings)\
**Post date:** [April 25, 2008, 4:23pm UTC](https://www.ruby-forum.com/t/order-by-date-for-archive-page-types/134687/3 "2008-04-25T16:23:33Z")

</div>

I would also like to know the answer to this.

---

<div class="post-metadata">

**Author:** ![imakethings](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ce7236/32.png) [@imakethings](https://www.ruby-forum.com/u/imakethings)\
**Post date:** [April 25, 2008, 6:31pm UTC](https://www.ruby-forum.com/t/order-by-date-for-archive-page-types/134687/4 "2008-04-25T18:31:30Z")

</div>

Arik J. wrote:

> Is there a way to order child pages of an archive page type by the  
> publish date? Its currently ordered alphabetically.

Or what about ordering in general? I want to do an \<r:children:each\>  
loop but I want the admin to be able to choose the order. The admin  
seems to lack any sort of page sorting functionality.

So, manual or automatic, how is this done?

---

<div class="post-metadata">

**Author:** ![imakethings](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ce7236/32.png) [@imakethings](https://www.ruby-forum.com/u/imakethings)\
**Post date:** [April 28, 2008, 6:02am UTC](https://www.ruby-forum.com/t/order-by-date-for-archive-page-types/134687/5 "2008-04-28T06:02:55Z")

</div>

Thats great and all, but I think people are more concerned about  
ordering in the admin, not in your public pages as that option is  
already there. But thanks though.

David P. wrote:

> Alex W. wrote:
> 
> > Or what about ordering in general? I want to do an \<r:children:each\>  
> > loop but I want the admin to be able to choose the order. The admin  
> > seems to lack any sort of page sorting functionality.
> > 
> > So, manual or automatic, how is this done?
> 
> The following will let you determine the page order in front-end  
> (non-admin) page listings. The key here is that the ‘by’ field refers to  
> a database field, not the equivalent Radiant tag (for example,  
> ‘published\_at’ vs ‘date’)…
> 
> \<r:children:each order=‘desc’ by=‘published\_at’ status=‘published’\>  
> …  
> \</r:children:each\>
> 
> - Dave

---

<div class="post-metadata">

**Author:** ![imakethings](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ce7236/32.png) [@imakethings](https://www.ruby-forum.com/u/imakethings)\
**Post date:** [April 28, 2008, 6:05am UTC](https://www.ruby-forum.com/t/order-by-date-for-archive-page-types/134687/6 "2008-04-28T06:05:00Z")

</div>

However, using the Reorder extension (non-ajax), it automatically places  
new pages at the top of list. Its not exactly what I’m looking for as it  
uses the position field in the pages table to determine ordering. But it  
works great when you’re starting your archive from scratch.

---

<div class="post-metadata">

**Author:** ![imakethings](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ce7236/32.png) [@imakethings](https://www.ruby-forum.com/u/imakethings)\
**Post date:** [April 25, 2008, 7:24pm UTC](https://www.ruby-forum.com/t/order-by-date-for-archive-page-types/134687/7 "2008-04-25T19:24:57Z")

</div>

Alex W. wrote:

> Or what about ordering in general? I want to do an \<r:children:each\>  
> loop but I want the admin to be able to choose the order. The admin  
> seems to lack any sort of page sorting functionality.
> 
> So, manual or automatic, how is this done?

The following will let you determine the page order in front-end  
(non-admin) page listings. The key here is that the ‘by’ field refers to  
a database field, not the equivalent Radiant tag (for example,  
‘published\_at’ vs ‘date’)…

\<r:children:each order=‘desc’ by=‘published\_at’ status=‘published’\>  
…  
\</r:children:each\>

- Dave
