Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# Site structure:
/ - homepage (normal)
/2008 - 2008 articles (normal)
/2008/article1 [was draft, now published]
/2009 - 2009 articles (normal)
/2009/article1 [was draft, now published]
/2010 - 2010 articles (normal)
# Template for homepage:
<r:aggregate urls="/2008; /2009; /2010">
<r:children:each limit="9999" order="desc">
<li><r:date format="%B %d, %Y" /> <r:link /></li>
# Expected Result:
* /2010/article1
* /2009/article3
* /2009/article2
* /2009/article1
* /2008/article1
# Current Result:
* /2009/article3
* /2009/article2
* /2008/article1
* /2010/article1
* /2009/article1
(the bottom two which are not obeying sort order were drafts)
=> problem was by="publication_date" isn’t default for <r:aggregate> so it was sorting by id (order pages were added in). Changing to <r:children:each limit="9999" order="desc" by="publication_date"> worked. Thanks Sean!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.