In the footer there is a column showing the images of the most recent entries. How do you prevent the image from the main entry itself to be shown?

Do you test an url segment against the title or slug?

This cannot be too complicated, but I am not able to find an example to get me started.

Added Code (thank you Robin)

{% set recents = craft.entries.section('sectionName').id('not ' ~ entry.id).all() %}
{% for entry in recents %}
<li><a href="{{ entry.url }}"><img src="{{ entry.carousel.one().getUrl('footerThumbs') }}" class="img-responsive" alt="{{ entry.title }}" /></a></li>
{% endfor %}

One more question: How do you limited the output using the elementCriteriaModel? Invoking Limit(x) on the array is not possible.


You can exclude the current entry from your query

{% recents = craft.entries.id('not ' ~ entry.id).find() %} 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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