Sheath rule
statamic-tag-pair-required
The Statamic
scope tag must receive paired content.
#Why
The core scope tag transforms its child content. A self-closing component or
an empty fluent content value cannot produce the scoped result.
#Examples
#Bad
{{-- scope needs child content, so it cannot be self-closing. --}}
<s:scope:article />
#Good
{{-- The paired scope tag has content to transform. --}}
<s:scope:article>
<h2>{{ $article['title'] }}</h2>
</s:scope:article>
{{-- Fluent scope calls also receive content to transform. --}}
{{ Statamic::tag('scope:article')->withContent($content) }}
#Notes
The requirement applies to component tags, executed fluent calls, and @tags.
An @tags definition always reports because that form cannot supply paired
content.
The requirement does not apply when the application replaces Statamic's core
scope tag registration.
#See Also
Related documentation covers the supported Statamic invocation surfaces:
- Statamic Plugin: Compare component, fluent, and directive forms
- statamic-tags-directive-tag-exists: Validate literal
@tagsnames