Created
March 15, 2013 02:09
-
-
Save mikeumus/5166984 to your computer and use it in GitHub Desktop.
How to call getCollection() from a doc inside the collection?
This file contains hidden or 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
<% for document in @getCollection('./blogs').toJSON(): %> | |
<li typeof="sioc:Page" about="<%= document.url %>" class="<%= 'active' if @document.url is document.url %>"> | |
<a href="<%= document.url %>" property="dc:title"><%= document.title %></a> | |
</li> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The above causes the following error:
error: An error occured:
TypeError: Cannot call method 'toJSON' of undefined
One workaround is to have the posts folder lower than the getCollection('posts') or in another documents/posts folder.