-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a way to disambiguate taxonomy tags from system tags in views #1195
Comments
What do you mean "types" of tags? If you have a taxonomy named section, |
The $ can be used to disambiguate the variable, but what would you use to disambiguate the taxonomy? Eg how would you use this disambiguation to work with a taxonomy called 'section', such as:
|
|
ohhh I seeee - the taxonomy object is just another variable? I'd understood taxonomies were a special kind of tag. Ok, sorry, my bad. I'll close this, but I'll have a look if there's anything I can contribute to the docs page after learning from my confusion. Thanks for clarifying for me. |
Ok, I submitted a PR to add a sentence in two places in the docs to explain this to newbs like me. |
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 }}
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.
The text was updated successfully, but these errors were encountered: