templates/front/catalog/category/view.html.twig line 111

Open in your IDE?
  1. {% extends 'front/front.html.twig' %}
  2. {% block javascripts %}
  3. <script>
  4. config.categoryId = {{ category.id }};
  5. </script>
  6. <script src="{{ asset('js/filters.js') }}"></script>
  7. {% endblock %}
  8. {% block structuredData %}
  9. {% set cpt = 1 %}
  10. <script type="application/ld+json">
  11. {
  12. "@context": "https://schema.org",
  13. "@type": "BreadcrumbList",
  14. "itemListElement":
  15. [
  16. {
  17. "@type": "ListItem",
  18. "position": {{ cpt }},
  19. "item":
  20. {
  21. "@id": "{{ url('index') }}",
  22. "name": "{% trans %}Vivog | Matériel pour les toiletteurs et éleveurs{% endtrans %}"
  23. }
  24. },
  25. {% for p in path %}
  26. {% set cpt = cpt + 1 %}
  27. {
  28. "@type": "ListItem",
  29. "position": {{ cpt }},
  30. "item":
  31. {
  32. {% if loop.index == 1 %}
  33. "@id": "{{ url('universe',{url:p.url,id:p.id}) }}",
  34. {% else %}
  35. "@id": "{{ url('category',{url:p.url,id:p.id}) }}",
  36. {% endif %}
  37. "name": "{{ p.name }}"
  38. }
  39. },
  40. {% endfor %}
  41. {% set cpt = cpt + 1 %}
  42. {
  43. "@type": "ListItem",
  44. "position": {{ cpt }},
  45. "item":
  46. {
  47. "@id": "{{ url('category',{url:category.url,id:category.id}) }}",
  48. "name": "{{ category.name }}"
  49. }
  50. }
  51. ]
  52. }
  53. </script>
  54. {% endblock %}
  55. {% block bodyClass %}category{% endblock %}
  56. {% block metas %}
  57. <title>{{ categoryDescription.headTitleTag ? categoryDescription.headTitleTag : categoryDescription.name }} {% if page > 1 %}(page {{ page }}){% endif %}</title>
  58. <meta name="description" content="{{ categoryDescription.headDescTag ? categoryDescription.headDescTag : categoryDescription.description|metadescription }}">
  59. {% if category.parent %}
  60. {% if page > 1 %}
  61. <link rel="canonical" href="{{ url('category',{id:category.id, url:category.url, page:page}) }}" />
  62. {% else %}
  63. <link rel="canonical" href="{{ url('category',{id:category.id, url:category.url}) }}" />
  64. {% endif %}
  65. {% else %}
  66. <link rel="canonical" href="{{ url('universe',{id:category.id, url:category.url}) }}" />
  67. {% endif %}
  68. {% if nbPages > 1 %}
  69. {% if page > 2 %}
  70. <link rel="prev" href="{{ url('category',{id:category.id, url:category.url, page:page-1}) }}" />
  71. {% elseif page == 2 %}
  72. <link rel="prev" href="{{ url('category',{id:category.id, url:category.url}) }}" />
  73. {% endif %}
  74. {% if page < nbPages %}
  75. <link rel="next" href="{{ url('category',{id:category.id, url:category.url, page:page+1}) }}" />
  76. {% endif %}
  77. {% endif %}
  78. {% endblock %}
  79. {% block featured %}{% endblock %}
  80. {% block breadcrumbs %}
  81. {% include 'front/layout/breadcrumbs.html.twig' with {category:category} %}
  82. {% endblock %}
  83. {% block content %}
  84. <div class="ctn category-view {{ category.isRoot() ? 'category-view-universe' : ''}}">
  85. {% if is_granted('ROLE_ADMIN') %}
  86. <div class="admin-tools">
  87. <a href="{{ path('admin_category_edit',{id:category.id}) }}" class="admin-update" target="_blank">modifier la catégorie</a>
  88. </div>
  89. {% endif %}
  90. <h1>{{ categoryDescription.headingTitle }} {% if page > 1 %}(page {{ page }}){% endif %}</h1>
  91. {% if not category.isRoot() %}
  92. <aside>
  93. <nav>
  94. {% include 'front/catalog/category/tree.html.twig' with {category:attribute(path, 0), path:path, current:category} %}
  95. </nav>
  96. </aside>
  97. {% endif %}
  98. <div{% if not category.isRoot() %} class="center"{% endif %}>
  99. <div class="product-ctn">
  100. {% include 'front/catalog/product/list.html.twig' with { products:products, productTitleTag:'h2', listClass:(category.isRoot() ? 'wide-list' : '') }%}
  101. </div>
  102. </div>
  103. </div>
  104. {{ render(controller(
  105. 'App\\Controller\\Front\\Modules\\SeenProductsController::block',
  106. { 'request': app.request }
  107. )) }}
  108. <div class="ctn">
  109. {% if category.tags %}
  110. <div class="rte tags">
  111. <div class="title-ctn">
  112. <div class="title">{% trans %}Craquez aussi pour...{% endtrans %}</div>
  113. </div>
  114. {{ categoryDescription.tags|raw }}
  115. </div>
  116. {% endif %}
  117. {% if category.description %}
  118. <div class="rte seo">
  119. <div class="title-ctn">
  120. <div class="title">{% trans %}Tout savoir sur{% endtrans %} "{{ category.name }}"</div>
  121. </div>
  122. <div class="description">{{ categoryDescription.description|raw }}</div>
  123. </div>
  124. {% endif %}
  125. <div class="footer-spacer"></div>
  126. </div>
  127. {% endblock %}