Sheath rule
statamic-collection-method-compatibility
#Why
The next, previous, older, and newer methods derive their ordering from
the current entry and its collection. Unsupported parameters or incompatible
collection settings prevent the intended neighbor from being selected.
#Examples
#Bad
{{-- Collection navigation methods do not support paginate. --}}
<s:collection:next current="article-id" paginate="10" />
#Good
{{-- limit is supported by collection navigation methods. --}}
<s:collection:next current="article-id" limit="1" />
{{-- The same restriction applies to fluent calls. --}}
{{ Statamic::tag('collection:previous')->limit('1') }}
#Project Checks
When current is a literal entry ID, the rule checks the entry and its
collection. It reports a missing entry, an incompatible date-based method,
an unsupported sort override, or a missing order value needed by the
collection's sort field.
Dynamic current IDs and dynamic sort values are skipped because project state cannot determine the runtime target.
#Notes
An explicit from value does not override the collection of the current entry
for these navigation methods. This matches Statamic's collection selection
behavior.
#See Also
Related rules validate query controls and literal resources:
- statamic-incompatible-query-parameters: Check general result-query conflicts
- statamic-resource-exists: Verify literal collection and entry-related resources