category

The category object has the following attributes:


category.id

Returns the id of the category.


category.image

Returns a image object of the category's banner.

Input

{% if category.image %}
<div class="category-image" style="background-image: url({{ category.image.url }})">
</div>
{% endif %}

Output

<div class="category-image" style="background-image: url(https://cdn.selly.io/s/dbe57d3c3ffd42793ead029443ba6c57bd924886...)">
</div>

category.parent_category_id

Returns the parent category id of the category.


category.products

An array of the product objects in the category.


category.product_ids

An array of the product IDs in the category. For any size/count checks, use category.product_ids and not category.products.


category.title

Returns the title of the category.