{% extends 'oscar/catalogue/browse.html' %}
{% load i18n ocyanjson %}
{% load wagtailcore_tags %}


{% block title %}{{ category.get_meta_title }}{% wagtail_site as current_site %}{% if current_site.site_name %} - {{ current_site.site_name }}{% endif %}{% endblock %}


{% block description %}{{ category.get_meta_description }}{% endblock %}

{% block header_title %}{{category.name}}{% endblock %}

{% block breadcrumbs %}
<nav aria-label="breadcrumb">
    <ol class="breadcrumb">
        <li class="breadcrumb-item"><a href="{{ homepage_url }}">{% trans "Home" %}</a></li>
        {% for category in category.get_ancestors %}
        <li class="breadcrumb-item"><a href="{{ category.get_absolute_url }}">{{ category.name }}</a></li>
        {% endfor %}
        <li class="breadcrumb-item active" aria-current="page">{{ category.name }}</li>
    </ol>
</nav>
{% endblock breadcrumbs %}

{% block headertext %}{{ category.name }}{% endblock %}

{#% only show the category description on page 1 to avoid duplicate content errors %#}
{% block category_top %}{% if not page_obj.number or page_obj.number <= 1 %}{% ocyanjson "themes" "category_desciption_position" "top" as category_desciption_position %}{% if category_desciption_position != "bottom" %}
{% include "oscar/catalogue/partials/category_description.html" with readmore=True %}
{% endif %}{% endif %}{% endblock %}

{% block category_bottom %}{% if not page_obj.number or page_obj.number <= 1 %}{% ocyanjson "themes" "category_desciption_position" "top" as category_desciption_position %}{% if category_desciption_position == "bottom" %}
{% include "oscar/catalogue/partials/category_description.html" with readmore=False %}
{% endif %}{% endif %}{% endblock %}
