Blog Sections Open
Accessing Template Placeholders from a Nested Snippet
A parser guide for cases where a snippet is called inside an item template and needs access to placeholders created by the outer listing snippet.
Nested parser logic gets confusing fast. A classic example is calling a snippet inside a listing item template and expecting it to read placeholders such as id or custom item fields from the outer snippet context.
The problem
Depending on whether the inner snippet call is cached or uncached, it may see the first parsed placeholder value, no value at all, or a value from the wrong parsing stage.
Why this happens
- placeholders are scoped to a parser phase, not to a human idea of “current item”
- cached inner snippets can capture early state
- uncached inner snippets may run after the placeholder context is already gone
Safer strategies
- pass the needed value directly as a parameter
- compute the output in the outer snippet before the template renders
- avoid deep snippet-in-snippet dependencies when a prepare step would be cleaner
In other words, if a nested snippet depends on an item placeholder, make that dependency explicit instead of hoping the parser context will stay available.
Looping Through Filled TV Fields Without Hard-Coding Every Attribute
A modeling pattern for product-like resources where only filled TV fields should appear in the output instead of a fixed hard-coded list.
Fixing Reflect Archives That Show January 1970 for pub_date
A practical archive-filtering note for Reflect and Ditto setups where publication-date archives accidentally generate an empty 1970 bucket.