From 8081fba8d51fb70bd1fa7e96edac72902fee6e96 Mon Sep 17 00:00:00 2001 From: Steve Parks Date: Fri, 9 Aug 2024 17:18:35 +0100 Subject: [PATCH 1/2] Add explanation of disambiguating taxonomies from other tags --- content/collections/docs/taxonomies.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/content/collections/docs/taxonomies.md b/content/collections/docs/taxonomies.md index 9e27705a8..450d55d53 100644 --- a/content/collections/docs/taxonomies.md +++ b/content/collections/docs/taxonomies.md @@ -132,6 +132,11 @@ When the collection can be inferred, the `url` and `permalink` values will inclu - ✅ Looping through terms in a taxonomy tag pair, using the collection parameter. - ❌ Looping through terms in a taxonomy tag pair, without specifying a collection. +:::tip +The tags based on your taxonomy names, eg {{ tags }}, can be disambiguated from other Statamic tags by prefixing with $. +For example, if you have a taxonomy called 'Section', its tag would clash with Statamic's own {{ section }} tag. So you can reference it with {{ $section }}. +::: + ### Listings and Indexes When on a [taxonomy route](#routing), you can list the terms by using a `terms` tag pair. For example: From f20ef2a35c9787195ff90f5936e527dca7bef6a0 Mon Sep 17 00:00:00 2001 From: Steve Parks Date: Fri, 9 Aug 2024 16:38:41 +0000 Subject: [PATCH 2/2] Add reference to collections and taxonomies when disambiguating variables on antlers page --- content/collections/docs/antlers.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/content/collections/docs/antlers.md b/content/collections/docs/antlers.md index 5cf64c563..5c12dcb0c 100644 --- a/content/collections/docs/antlers.md +++ b/content/collections/docs/antlers.md @@ -328,6 +328,8 @@ As your templates grow and increase in complexity, you _may_ find yourself unsur {{ $content }} ``` +This includes variables that Statamic creates for you, such as the objects of your collections or taxonomies. For example, a taxonomy called 'Section' could be disambiguated from Statamic's own Section tag by referencing it as ```{{ $section }}```. + ### Modifiers Modifiers change the output of an Antlers variable. They are used inside any expression and are separated by a pipe character `|`.