<p>Because your Entry URI is setup as my-channel/{slug} , When you go to my-channel/post-slug-1 Craft automatically sets the variable 'entry' to the entry post-slug-1. You don't need to loop through the channel at this point. You can just use the entry variable.</p>

<pre><code>entry.fieldName
entry.slug
entry.url 
</code></pre>

<p>etc...</p>

<p>So just remove your for loop and use 'entry'</p>

<p>Using</p>

<pre><code>{% for entry in craft.entries.section('my-channel').limit(1).all() %}
</code></pre>

<p>Will get the first entry of the my-channel section. That's useful for pages where you need to list out all of your entries in that section or get specific ones.</p>

CC BY-SA 4.0
2018-12-11T14:10:16.447Z
Thank you for the reply and the explanation. It worked out Great :)
Joe
CC BY-SA 4.0
2018-12-11T13:29:14.843Z
2018-12-11T13:29:14.843Z
Chattervast
<p>I hope someone can help me to understand this.</p>

<p>I have a Channel called eg. "My channel". In that channel i have two entries:<br> Post 1 and Post 2. Those two entries have different titles and content.</p>

<p>If I go to "my-channel/post-1" in the browser, and then to "my-channel/post-2" they have the same content based on the Post 2 (last created entry).</p>

<p>If I make "Post 2" inactive, then Post 1 will have the correct content.</p>

<p>What am i forgetting here?</p>

CC BY-SA 4.0
2018-12-11T13:00:52.563Z
How is your section Entry URI Format and Template setup?
Chattervast
CC BY-SA 4.0
2018-12-11T13:17:52.990Z
My entry URI is: my-channel/{slug} , and in the folder templates I have the folder my-channel with a _entry.twig file in it.

It is like it takes the latest created entry and then all the slugs goes to that content.
Joe
CC BY-SA 4.0
2018-12-11T13:21:20.377Z
Is your _entry.twig file setting the entry manually or are you retrieving all of the channel at some point in the template?
Chattervast
CC BY-SA 4.0
2018-12-11T13:25:54.277Z
Do you mean like the for loop: {% for entry in craft.entries.section('my-channel').limit(1).all() %}
Joe
<slug><channels><entry-slug>
Same content on different slugs
# Same content on different slugs

(Asked by: username_0 on 2018-12-11)

I hope someone can help me to understand this.

I have a Channel called eg. "My channel". In that channel i have two entries:  
 Post 1 and Post 2. Those two entries have different titles and content.

If I go to "my-channel/post-1" in the browser, and then to "my-channel/post-2" they have the same content based on the Post 2 (last created entry).

If I make "Post 2" inactive, then Post 1 will have the correct content.

What am i forgetting here?

**Tags:** slug, channels, entry-slug
> **Comments:**
> **username_1**: How is your section Entry URI Format and Template setup?  
> **username_0**: My entry URI is: my-channel/{slug} , and in the folder templates I have the folder my-channel with a _entry.twig file in it.  It is like it takes the latest created entry and then all the slugs goes to that content.  
> **username_1**: Is your _entry.twig file setting the entry manually or are you retrieving all of the channel at some point in the template?  
> **username_0**: Do you mean like the for loop: {% for entry in craft.entries.section('my-channel').limit(1).all() %}  

---

## 1 answers

### Answer by username_1 on 2018-12-11. Score: 2 | Accepted answer

Because your Entry URI is setup as my-channel/{slug} , When you go to my-channel/post-slug-1 Craft automatically sets the variable 'entry' to the entry post-slug-1. You don't need to loop through the channel at this point. You can just use the entry variable.
entry.fieldName
entry.slug
entry.url 

etc...
So just remove your for loop and use 'entry'
Using
{% for entry in craft.entries.section('my-channel').limit(1).all() %}

Will get the first entry of the my-channel section. That's useful for pages where you need to list out all of your entries in that section or get specific ones.

> **Comments:**
> **username_0**: Thank you for the reply and the explanation. It worked out Great :)  

---

