<p>You can exclude the current entry from your query</p>

<pre><code>{% recents = craft.entries.id('not ' ~ entry.id).find() %} 
</code></pre>

CC BY-SA 3.0
2018-04-15T09:28:17.980Z
2018-04-15T09:28:17.980Z
Robin Schambach
<p>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?</p>

<p>Do you test an url segment against the title or slug?</p>

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

<p><strong>Added Code</strong> (thank you Robin)</p>

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

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

<templating><elementcriteriamodel>
Not showing the entry somewhere else on the same page
# Not showing the entry somewhere else on the same page

(Asked by: username_0 on 2018-04-15)

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 %}

{% endfor %}

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

**Tags:** templating, elementcriteriamodel

---

## 1 answers

### Answer by username_1 on 2018-04-15. Score: 1

You can exclude the current entry from your query
{% recents = craft.entries.id('not ' ~ entry.id).find() %}


---

