Skip to content
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

Expand explanations of disambiguating tags and variables #1434

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions content/collections/docs/antlers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `|`.
Expand Down
5 changes: 5 additions & 0 deletions content/collections/docs/taxonomies.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down