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 %}
<li><a href="{{ siteUrl }}tags/{{ tag.title | kebab}}">{{ tag.title }}</a></li>
{% 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.