Sheath rule
statamic-antlers-region-pairs
Embedded Antlers regions must be balanced and cannot be nested.
#Why
Statamic treats the first @antlers and @endantlers pair as one embedded
Antlers region. Missing, orphaned, or nested markers can cause Blade content to
be interpreted as Antlers, or Antlers content to be interpreted as Blade.
#Examples
#Bad
{{-- Nested Antlers regions are not supported. --}}
@antlers
{{ title }}
@antlers {{ subtitle }} @endantlers
@endantlers
#Good
{{-- One balanced region contains both expressions. --}}
@antlers
{{ title }}
{{ subtitle }}
@endantlers
An @antlers without @endantlers and an orphaned @endantlers are also
reported.
#Notes
A region with unbalanced or nested markers produces the structural finding without additional Antlers syntax findings from the same region.
#See Also
Related documentation covers Antlers syntax and plugin setup:
- statamic-antlers-region-syntax: Validate the contents of a sound region
- Statamic Plugin: Install and configure the Statamic preset