Skip to content

Add a way to disambiguate taxonomy tags from system tags in views #1195

Closed
@steveparks

Description

@steveparks

I created a taxonomy called 'Section', with the intention I could have paths like '/blog/section/{tag}'

Then, in my views I wanted to display the terms assigned to an entry on its view with {{ section }}

  • ...
  • {{ /section }}.

    This didn't work.

    In researching why, I found there is a Statamic system tag called {{ section }}, and this appears to create a conflict.

    So I guess that taxonomies can't be named the same thing as any of the existing Statmic tags.

    As section (and collection) are words that could often be used for taxonomies, it would be useful if there was a way of disambiguating between Statamic system tags and taxonomy tags in views.

    At the moment in a view, % can be used to signify a tag, and $ for a variable. But the % doesn't distinguish between types of tag.

    I suggest introducing an additional character, perhaps ^ to disambiguate Taxonomy tags in views. This will allow content designers and editors to name taxonomies anything they like, while enabling developers to build views that they know won't break.

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      No labels
      No labels

      Type

      No type

      Projects

      No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions