{% extends 'front/front.html.twig' %}
{% block javascripts %}
<script>
config.categoryId = {{ category.id }};
</script>
<script src="{{ asset('js/filters.js') }}"></script>
{% endblock %}
{% block structuredData %}
{% set cpt = 1 %}
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement":
[
{
"@type": "ListItem",
"position": {{ cpt }},
"item":
{
"@id": "{{ url('index') }}",
"name": "{% trans %}Vivog | Matériel pour les toiletteurs et éleveurs{% endtrans %}"
}
},
{% for p in path %}
{% set cpt = cpt + 1 %}
{
"@type": "ListItem",
"position": {{ cpt }},
"item":
{
{% if loop.index == 1 %}
"@id": "{{ url('universe',{url:p.url,id:p.id}) }}",
{% else %}
"@id": "{{ url('category',{url:p.url,id:p.id}) }}",
{% endif %}
"name": "{{ p.name }}"
}
},
{% endfor %}
{% set cpt = cpt + 1 %}
{
"@type": "ListItem",
"position": {{ cpt }},
"item":
{
"@id": "{{ url('category',{url:category.url,id:category.id}) }}",
"name": "{{ category.name }}"
}
}
]
}
</script>
{% endblock %}
{% block bodyClass %}category{% endblock %}
{% block metas %}
<title>{{ categoryDescription.headTitleTag ? categoryDescription.headTitleTag : categoryDescription.name }} {% if page > 1 %}(page {{ page }}){% endif %}</title>
<meta name="description" content="{{ categoryDescription.headDescTag ? categoryDescription.headDescTag : categoryDescription.description|metadescription }}">
{% if category.parent %}
{% if page > 1 %}
<link rel="canonical" href="{{ url('category',{id:category.id, url:category.url, page:page}) }}" />
{% else %}
<link rel="canonical" href="{{ url('category',{id:category.id, url:category.url}) }}" />
{% endif %}
{% else %}
<link rel="canonical" href="{{ url('universe',{id:category.id, url:category.url}) }}" />
{% endif %}
{% if nbPages > 1 %}
{% if page > 2 %}
<link rel="prev" href="{{ url('category',{id:category.id, url:category.url, page:page-1}) }}" />
{% elseif page == 2 %}
<link rel="prev" href="{{ url('category',{id:category.id, url:category.url}) }}" />
{% endif %}
{% if page < nbPages %}
<link rel="next" href="{{ url('category',{id:category.id, url:category.url, page:page+1}) }}" />
{% endif %}
{% endif %}
{% endblock %}
{% block featured %}{% endblock %}
{% block breadcrumbs %}
{% include 'front/layout/breadcrumbs.html.twig' with {category:category} %}
{% endblock %}
{% block content %}
<div class="ctn category-view {{ category.isRoot() ? 'category-view-universe' : ''}}">
{% if is_granted('ROLE_ADMIN') %}
<div class="admin-tools">
<a href="{{ path('admin_category_edit',{id:category.id}) }}" class="admin-update" target="_blank">modifier la catégorie</a>
</div>
{% endif %}
<h1>{{ categoryDescription.headingTitle }} {% if page > 1 %}(page {{ page }}){% endif %}</h1>
{% if not category.isRoot() %}
<aside>
<nav>
{% include 'front/catalog/category/tree.html.twig' with {category:attribute(path, 0), path:path, current:category} %}
</nav>
</aside>
{% endif %}
<div{% if not category.isRoot() %} class="center"{% endif %}>
<div class="product-ctn">
{% include 'front/catalog/product/list.html.twig' with { products:products, productTitleTag:'h2', listClass:(category.isRoot() ? 'wide-list' : '') }%}
</div>
</div>
</div>
{{ render(controller(
'App\\Controller\\Front\\Modules\\SeenProductsController::block',
{ 'request': app.request }
)) }}
<div class="ctn">
{% if category.tags %}
<div class="rte tags">
<div class="title-ctn">
<div class="title">{% trans %}Craquez aussi pour...{% endtrans %}</div>
</div>
{{ categoryDescription.tags|raw }}
</div>
{% endif %}
{% if category.description %}
<div class="rte seo">
<div class="title-ctn">
<div class="title">{% trans %}Tout savoir sur{% endtrans %} "{{ category.name }}"</div>
</div>
<div class="description">{{ categoryDescription.description|raw }}</div>
</div>
{% endif %}
<div class="footer-spacer"></div>
</div>
{% endblock %}