You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, if we want to include the rendered content of a particular layout (but not all of them) in a content listing then we have to move that layout into a partial and include it in the document's content - as we either have document.contentRendered that includes the rendered content of all layouts, or document.contentRenderedWithoutLayouts with no layouts - nothing in between
It would be nice to have something like document.contentRenderedWithLayout as an object containing the rendered content of each layout inside it, as well as an array of the order. So we could do document.contentRenderedWithLayout.page to fetch the data of the page layout (wraps the content in an article) and not with the default layout (wraps the content in html structure). We could also do document.contentRenderedWithLayout[0] to get the first layout rendered perhaps.
This would allow us to do something like this:
<h2>Posts:</h2><ul><% for post in @getFilesAtPath('posts/').toJSON(): %><li><%- post.contentRenderedWithLayout.page %></li><% end %></ul>
Right now, if we want to include the rendered content of a particular layout (but not all of them) in a content listing then we have to move that layout into a partial and include it in the document's content - as we either have
document.contentRendered
that includes the rendered content of all layouts, ordocument.contentRenderedWithoutLayouts
with no layouts - nothing in betweenIt would be nice to have something like
document.contentRenderedWithLayout
as an object containing the rendered content of each layout inside it, as well as an array of the order. So we could dodocument.contentRenderedWithLayout.page
to fetch the data of the page layout (wraps the content in an article) and not with the default layout (wraps the content in html structure). We could also dodocument.contentRenderedWithLayout[0]
to get the first layout rendered perhaps.This would allow us to do something like this:
Would output this:
Reference structure is here: docpad/docpad-plugin-multiplelayouts#1
Want to back this issue? Place a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: