Best solution for articles tag page? I've been looking through the forum, it seems there's a few methods to retrieve a tags page but I'm looking for the most efficient method (both speed- and template-wise).


Using tag.name with tag token (routes), which utilises the original article template for rendering.
Using tag.slug
Using tag.title and search()


I think #2 is the simplest and prettiest solution, but it's relatively undocumented as far as I can tell. Also, I'm using two tag groups and, although I've mentioned to my client to not add duplicate tags (e.g. { 'group 1': 'stress' } { 'group 2': 'Stress' } I'm interested to know the following:


Is #2 the most optimised solution?
Can it be used with a tag token route?
Will duplicate tags accross tag groups cause conflicts?


In my tests using #1 (the urls are ugly in my opinion), Depression seems to return no results, perhaps because there is already a depression tag in another tag group.

Ideally, I want one place for all tags, without having to create two different routes for both tag groups.
Ok, so I'm tenatively answering my own question — although I'd like someone to shed light on the duplicate tag problem — it seems like a combination of #1 and #2 works quite nicely, although I haven't extensively tested it yet.

{% if tag is defined %}
  {% set tag = craft.tags.slug(tag).first() %}
  {% set entries = craft.entries.section('articles').relatedTo(tag) %}
{% else %}
  {% set entries = craft.entries.section('articles') %}
{% endif %}

{% for entry in entries %}
  ...
{% endfor %}


This is working with the route articles/tag/[tag token] set up. The only issue is when a tag that has a duplicate slug, whether that be within the same tag group or a different one, it returns no results (I'm not great at reading logs, but it doesn't seem to throw any errors either).

Any additions to this answer would be appreciated!