0

I'm creating a site that uses a masonry grid layout as the homepage. It's designed in a way that the content is organised semi-randomly (I've chosen the randomness). I have portfolio images, which link to the single entry, showing in various blocks of the grid. My issue is that only the content in the first channel entries tag pair is parsing. For example here, only two entries are being displayed—

{exp:channel:entries channel="projects" limit="2"}
<div class="element">
<a href="{title_permalink='projects/index'}">
<figure class="images"><img src="{project_image:project_thumb}"/></figure>
</a>
</div>
{/exp:channel:entries}

some other elements here...

{exp:channel:entries channel="projects" limit="2"}
<div class="element">
<a href="{title_permalink='projects/index'}">
<figure class="images"><img src="{project_image:project_thumb}"/></figure>
</a>
</div>
{/exp:channel:entries}

Is it possible to have multiple channel entries tags, displaying information from the same channel, on one page?

Thanks in advanced.

1 Answer 1

0

I thought it should be possible. Anyway, you should avoid calling the channel entries tag multiple times because it is quite an heavy operation. You could solve it like this:

{exp:channel:entries channel="projects" limit="4" dynamic="off"}
{if count == 3}some other elements here...{/if}
<div class="element">
<a href="{title_permalink='projects/index'}">
<figure class="images"><img src="{project_image:project_thumb}"/></figure>
</a>
</div>
{/exp:channel:entries}
6
  • Thanks for your solution. I should have mentioned that within the "Some other elements here..." section I have {exp:channel:entries} tags for other channels. Would this still be a viable option?
    – Elliot
    Jul 23, 2015 at 11:34
  • The use of the entries tag within the entries is not an option. You could use an embed in the if statement. Jul 23, 2015 at 11:47
  • Thanks for your help. I'll give embedding the other channels a go.
    – Elliot
    Jul 23, 2015 at 11:53
  • You are welcome. :) Let me know how it worked out for you. Jul 23, 2015 at 11:55
  • You should look at Stash. With it, you can do a load outside of the HTML, and then drop the content objects into the parts of the page, all in one pull
    – Holland
    Jul 23, 2015 at 15:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.