<p>For your link, change <code>{{ tag.title | kebab}}</code> to <code>{{ tag.slug }}</code></p>

<p>Then on your tag.html page change your <code>tag</code> variable to this:</p>

<p><code>{% set tag = craft.tags.slug( craft.request.segment(2) ).first() %}</code></p>

<p>This is how I have it set up and works fine.</p>

<p>Edit: Forgot the route needed: Add this to your routes.php: <code>'tags/{slug}' =&gt; 'tags/tag',</code></p>

CC BY-SA 3.0
2017-01-17T21:59:19.620Z
2017-01-17T21:59:19.620Z
Erik
<p>I have a page that displays entries based on a specific tag. It works well until I apply the <a href="https://craftcms.com/docs/templating/filters#kebab" rel="nofollow noreferrer">kebab filter.</a></p>
<p>Here's my link to the page:</p>
<pre><code>{% for tag in tag %}
    &lt;li&gt;&lt;a href=&quot;{{ siteUrl }}tags/{{ tag.title | kebab}}&quot;&gt;{{ tag.title }}&lt;/a&gt;&lt;/li&gt;
{% endfor %}
</code></pre>
<p>and my tags/tag.html page looks like this:</p>
<pre><code>{% set tag = craft.tags.name(tag).first() %}
{% set entries = craft.entries.relatedTo(tag).order('title') %}
{% if entries | length %}
   {% for entry in entries %}
       Code here
    {% endfor %}
{% endif %}
</code></pre>
<p>The page populates all entries regardless of the tag once I apply the kebab filter. How can I fix that?</p>
<p>Thanks in advance.</p>

<templating><entry><tag>
Populating TAG page when using the kebab filter
# Populating TAG page when using the kebab filter

(Asked by: username_0 on 2017-01-17)

I have a page that displays entries based on a specific tag. It works well until I apply the kebab filter.
Here's my link to the page:
{% for tag in tag %}
    {{ tag.title }}
{% endfor %}

and my tags/tag.html page looks like this:
{% set tag = craft.tags.name(tag).first() %}
{% set entries = craft.entries.relatedTo(tag).order('title') %}
{% if entries | length %}
   {% for entry in entries %}
       Code here
    {% endfor %}
{% endif %}

The page populates all entries regardless of the tag once I apply the kebab filter. How can I fix that?
Thanks in advance.

**Tags:** templating, entry, tag

---

## 1 answers

### Answer by username_1 on 2017-01-17. Score: 2 | Accepted answer

For your link, change `{{ tag.title | kebab}}` to `{{ tag.slug }}`

Then on your tag.html page change your `tag` variable to this:

`{% set tag = craft.tags.slug( craft.request.segment(2) ).first() %}`

This is how I have it set up and works fine.

Edit: Forgot the route needed: Add this to your routes.php: `'tags/{slug}' => 'tags/tag',`


---

