closest
Objects a section hands down to every theme block inside it.
A section passes them with {% content_for ‘blocks’, closest.product: product %}; any block below, however deep, reads closest.product. Use it so one block (a price, a buy button) works in every section that shows a product.
Available in: Theme blocks.
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
closest.product |
product | The product the section is about (when it passes one). |
Example
Section titled “Example”{{ closest.product.title | default: 'No product here' }}No product hereRelated
Section titled “Related”Compatibility
Section titled “Compatibility”Since theme platform 1.0.
Was this page helpful?

