I know that I can
{{#foreach posts}}
{{!-- do stuff --}}
{{/foreach}}
and I believe that I can
{{#foreach pages}}
{{!-- do stuff --}}
{{/foreach}}
However, I want to iterate over posts and pages, together. Perhaps something like this, though I’ve no idea what syntax might actually work, if it is indeed possible.
{{#foreach pages, posts}}
{{!-- do stuff --}}
{{/foreach}}
Have you iterated over both together?
Can you share the code you used?
**Context: **I’m aware that posts and pages are basically the same data entity. I’ve considered switching the relevantly-tagged pages to posts, but that facility seems to have vanished. I’ve not yet gone down the route of exporting / changing / re-importing – as I’d prefer within ghost to keep my pages pages, and my posts posts, yet to give my readers the chance to browse through some tagged content without having to make the distinction.
Use case: I want to show a list of everything on my site with a given tag. Some of those things are posts (tend to be ‘done’ when published, returned in date order etc.), and some are pages (change over time, returned in alphabetical order).