--- url: https://docs.youcan.shop/themes/objects/closest.md --- # `closest` object The nearest resource of each type for the section or block that is rendered. ### Properties *** | Name | Type | Description | | ------------ | :---------------------: | :--------------------------- | | `product` | [product](product) | The nearest product | | `collection` | [category](category) | The nearest collection | | `page` | [page](page) | The nearest page | | `blog` | object | The nearest blog | | `article` | object | The nearest article | ### Order For each property, you get the first value found in this list: 1. A setting of the same type on the section or block that is rendered: `product`, `collection`, `page`, `blog` or `article`. 2. A `closest.` argument on the [`content_for`](/themes/tags/content_for) tag of the block, for example `closest.product: featured_product`. 3. A setting of the same type on the nearest parent block, or on the section. 4. The resource of the template, for example the product on a product page. A setting with a [dynamic source](/themes/settings/overview#dynamic-sources) as its value is skipped, for example {{ closest.product }}. ```liquid {% if closest.product %}

{{ closest.product.title }}

{% endif %} ```