Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@oli
Created January 28, 2010 01:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oli/288364 to your computer and use it in GitHub Desktop.
Save oli/288364 to your computer and use it in GitHub Desktop.
# Site structure:
/ - homepage (normal)
/2008 - 2008 articles (normal)
/2008/article1 [was draft, now published]
/2009 - 2009 articles (normal)
/2009/article1 [was draft, now published]
/2009/article2
/2009/article3
/2010 - 2010 articles (normal)
/2010/article1
# 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>
</r:children:each>
</r:aggregate>
# 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