Created
January 28, 2010 01:57
-
-
Save oli/288364 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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