Themes built on the Twig templating engine are now deprecated and require migration to Vitrin to ensure continued support and compatibility with Zid.
/categorieslist_categories| Variable | Type |
|---|---|
categories | List[Category] |
store | Store |
session | Session |
| Property | Description |
|---|---|
category.id | ID |
category.name | Name |
category.slug | URL slug |
category.image | Image |
category.cover_image | Cover image |
category.sub_categories | Child categories |
{% extends "layout.jinja" %}
{% block main_content %}
<div class="categories">
{% for category in categories %}
<div class="category-card">
{% if category.cover_image %}
<img src="{{ category.cover_image }}" alt="{{ category.name }}">
{% endif %}
<a href="{{ url_for('category_details', category_id=category.id, slug=category.slug) }}">
{{ category.name }}
</a>
{% if category.sub_categories %}
{% for sub in category.sub_categories %}
<a href="{{ url_for('category_details', category_id=sub.id, slug=sub.slug) }}">
{{ sub.name }}
</a>
{% endfor %}
{% endif %}
</div>
{% endfor %}
</div>
{% endblock %}