All rules

Sheath rule

statamic-tags-directive-tag-exists

Literal Statamic @tags definitions must use registered handles and supported methods.
Package
Statamic
Category
Blade
Default severity
error by default
Auto-fix
Manual fix

#Why

Statamic dispatches each definition in @tags as a tag call. An unknown handle or method cannot produce the value assigned by the directive.

#Examples

#Bad

{{-- missing_tag is not registered. --}}
@tags(['articles' => 'missing_tag'])

#Good

{{-- Both definitions use registered tags and supported methods. --}}
@tags([
'articles' => 'collection:articles',
'topic_count' => ['taxonomy:count' => ['from' => 'topics']],
])

#Definition Shapes

A string value is treated as the tag name. For an array value, the first key is the tag name and the first value is its parameter map.

The final value for a repeated outer alias wins. Additional keys inside one tag definition are not dispatched.

#Notes

Dynamic names, dynamic keys, dynamic outer values, and unpacked outer maps are skipped when their result cannot be resolved.

#See Also

Related rules validate directive shape and required inputs: