I've got a page that I've created using the Pages module, and inside the template for that page I'm trying to display a list of entries from 4 different channels on my site. But the {exp:channel:entries} tag returns nothing. Using the Template Debugging I can see that this tag is attempting to retrieve a list of entries, but then it says that 0 entries were returned?
What am I doing wrong?
Answer
The key is to use dynamic=no in the {exp:channel:entries} tag. So instead of:
{exp:channel:entries channel="channel1|channel2"}
Use
{exp:channel:entries dynamic="no" channel="channel1|channel2"}
Of course, if you're already using the
{exp:channel:entries channel="pages"}
tag to access the page title, etc..., you can't embed another channel entries tag inside that tag, so you'll have to put your code into an embedded template.
So the end result would be something like:
{exp:channel:entries channel="pages"}
<h1>{title}</h1>
<!-- other page code stuff -->
<!-- now embed your template that uses the channel entries with dynamic=no -->
{embed="<yourtemplategroup>/<yourembeddedtemplate"}
{/exp:channel:entries}