Sheath rule
statamic-special-child-placement
Statamic
slot and no_results tags must be direct children of compatible
parent tags.
#Why
These special tags are interpreted by their immediate parent. Outside the expected structure, they cannot provide a partial slot or an empty-results branch.
#Examples
#Bad
{{-- slot has no parent partial to receive it. --}}
<s:slot:title>Featured article</s:slot:title>
#Good
{{-- slot is a direct child of partial. --}}
<s:partial src="cards/article">
<s:slot:title>Featured article</s:slot:title>
</s:partial>
{{-- no_results is a direct child of a result-producing tag. --}}
<s:collection:articles>
<h2>{{ $title }}</h2>
<s:no_results>No articles found.</s:no_results>
</s:collection:articles>
#Notes
Both colon and dot slot spellings are recognized. The reserved slot and
no_results names produce a placement finding only when their parent context is
invalid.
#See Also
Related rules validate the parent invocation:
- statamic-tag-exists: Require a registered parent tag
- statamic-tag-method-exists: Require a supported parent method