Display related entries across different entry types using tags in different tag groups? I'm working on a site that has two different entry types (e.g., "blog" and "photos"), and each type has it's own tag group. When viewing a particular entry, I'd like to display related entries found in both entry types.

So, for example, let's say that I've written "Entry A" and "Entry B" -- "Entry A" is in "blog" and "Entry B" is a "photos." They both have the same tag ("foo"), but that tag exists in each entry type's respective tag group.

If I view "Entry A," can I display a list of related entries that includes "Entry B" even though the tag that they share isn't in the same tag group?
Ok, I believe this does what you want:

{% if entry.tags1 | length %}

    {# get tag names from our current entry #}
    {% set entryTagNames = [] %}
    {% for tag in entry.tags1 %}
        {% set entryTagNames = entryTagNames | merge([tag.name]) %}
    {% endfor %}

    {% if entryTagNames | length %}

        {# get tags from the other tag group with the same names #}
        {% set otherTags = craft.tags({ group: 'group2', name: entryTagNames }) %}

        {# get entries related to these tags #}
        {% set retaledEntries = craft.entries({ section: 'news', relatedTo: otherTags }) %}

        {# output related entries. just debugging that this actually works #}
        {% for relatedEntry in retaledEntries %}
            {{ relatedEntry }}&lt;br&gt;
            {% for relatedEntryTag in relatedEntry.tags2 %}
                - {{ relatedEntryTag.name }}&lt;br&gt;
            {% endfor %}
            &lt;br&gt;
        {% endfor %}

    {% endif %}

{% endif %}


My first section, which the current entry is in, has a field named tags1, connected to the tag group group1. My second section is named news, has a field named tags2, connected to the tag group group2.

It seems a bit sketchy to rely on tag names, but.