templates/category/index.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}Category{% endblock %}
  3. {% block body %}
  4. {% include('partials/_breadcrumbs.html.twig') with {
  5. hero_title: "Category",
  6. hero_title_breadcrumb: "Category"
  7. } %}
  8. <section class="mt-5 mb-5">
  9. <div class="container" style="height: auto;">
  10. <div class="container-fluid" style="min-height: 10em;">
  11. <div data-controller="carousel" class="swiper swiper-container"
  12. data-carousel-options-value='{ "navigation": { "nextEl": ".swiper-button-next", "prevEl": ".swiper-button-prev" } }'>
  13. <div class="swiper-wrapper">
  14. {% set slug = app.request.attributes.get('slug') %}
  15. {% for categories in slides %}
  16. {% for category in categories %}
  17. <div class="swiper-slide" >
  18. <a href="{{ path('category', {
  19. slug: category.slug
  20. }) }}" style="overflow: visible;">
  21. <div class="{% if category.slug == slug %}bg-btn5 {% endif %}s-block p-3"
  22. data-tilt data-tilt-max="5" data-tilt-speed="1000">
  23. {% for block in category.content.blocks %}
  24. {% if block.type == "image" %}
  25. <div class="s-card-icon mx-auto my-2">
  26. <img src="{{ asset(block.data.file.url) }}"
  27. alt="{{ category.slug }}" class="img-fluid"/>
  28. </div>
  29. {% endif %}
  30. {% endfor %}
  31. <h4 class="h5{% if category.slug == slug %} text-white{% endif %}">
  32. {{ category.name|length > 30 ? category.name|slice(0, 30) ~ '...' : category.name }}</h4>
  33. </div>
  34. </a>
  35. </div>
  36. {% endfor %}
  37. {% endfor %}
  38. </div>
  39. <div class="swiper-pagination"></div>
  40. <div class="swiper-button-next"></div>
  41. <div class="swiper-button-prev"></div>
  42. </div>
  43. </div>
  44. <div class="container bg-light mt-4 rounded shadow-sm">
  45. {% if products is empty %}
  46. <div class="row align-content-center rounded" style="height: 20em;">
  47. <div class="col justify-content-center text-center">
  48. <h4 class="h5">No items found in this category.</h4>
  49. <p>please select a different category or try later.</p>
  50. </div>
  51. </div>
  52. {% else %}
  53. <div class="row upset link-hover shape-num justify-content-center">
  54. {% for product in products %}
  55. <div class="col-lg-4 col-md-6 border-light">
  56. <div class="pricing-table best-plan mt60 mb60 bg-gradient">
  57. <div class="inner-table mb40">
  58. <span class="title">{{ product.name }}</span>
  59. <p class="title-sub">{{ product.metadata }}</p>
  60. <h2>${{ product.price }}</h2>
  61. <p class="duration">Monthly Package</p>
  62. </div>
  63. <div class="row">
  64. <a href="{{ path('product' , {
  65. slug: product.slug
  66. }) }}" class="btn-main bg-btn3 lnk col-12 text-white">
  67. View Product
  68. <i class="fas fa-chevron-right fa-icon"></i>
  69. <span class="circle"></span>
  70. </a>
  71. </div>
  72. </div>
  73. </div>
  74. {% endfor %}
  75. </div>
  76. {% endif %}
  77. </div>
  78. {# <div class="card border-light shadow-sm"> #}
  79. {# <div class="row justify-content-center mt-3 ml-3 mr-3"> #}
  80. {# <ul class="nav nav-pills"> #}
  81. {# <li class="nav-item"> #}
  82. {# <a class="nav-link active">Category 1</a> #}
  83. {# </li> #}
  84. {# <li class="nav-item"> #}
  85. {# <a class="nav-link">Category 2</a> #}
  86. {# </li> #}
  87. {# <li class="nav-item"> #}
  88. {# <a class="nav-link">Category 3</a> #}
  89. {# </li> #}
  90. {# <li class="nav-item"> #}
  91. {# <a class="nav-link">Category 4</a> #}
  92. {# </li> #}
  93. {# </ul> #}
  94. {# </div> #}
  95. {# <div class="card-body ml-2 mr-2 mb-2 border rounded"> #}
  96. {# Item Cards go here. #}
  97. {# </div> #}
  98. {# </div> #}
  99. </div>
  100. </section>
  101. {% endblock %}