templates/blog/_sidebar.html.twig line 1

Open in your IDE?
  1. <div class="blog-sidebar">
  2.     {% if search is not defined %}
  3.         <div class="card mb-4 shadow-sm">
  4.             <div class="card-body">
  5.                 <h4 class="card-title h5 mb-3">Search</h4>
  6.                 <form action="{{ path('app_blog_search') }}" method="get" class="d-flex">
  7.                     <input type="text" name="q" class="form-control me-2" placeholder="Search blog..." required>
  8.                     <button type="submit" class="btn btn-primary">
  9.                         <i class="fa fa-search"></i>
  10.                     </button>
  11.                 </form>
  12.             </div>
  13.         </div>
  14.     {% endif %}
  15.     
  16.     <div class="card mb-4 shadow-sm">
  17.         <div class="card-body">
  18.             <h4 class="card-title h5 mb-3">Categories</h4>
  19.             <div class="list-group list-group-flush">
  20.                 {% for item in tags %}
  21.                     {% set tag = item.tag is defined ? item.tag : item %}
  22.                     {% set postCount = item.postCount is defined ? item.postCount : 0 %}
  23.                     
  24.                     <a href="{{ path('app_blog_tag', {'slug': tag.slug}) }}" 
  25.                        class="list-group-item list-group-item-action d-flex justify-content-between align-items-center
  26.                               {% if tag is defined and currentTag is defined and tag.id == currentTag.id %}active{% endif %}">
  27.                         {{ tag.name }}
  28.                         {% if postCount > 0 %}
  29.                             <span class="badge bg-primary rounded-pill">{{ postCount }}</span>
  30.                         {% endif %}
  31.                     </a>
  32.                 {% endfor %}
  33.             </div>
  34.         </div>
  35.     </div>
  36.     
  37.     <div class="card shadow-sm">
  38.         <div class="card-body">
  39.             <h4 class="card-title h5 mb-3">Subscribe</h4>
  40.             <p class="text-secondary mb-3">Get the latest fitness tips and health advice delivered to your inbox.</p>
  41.             <form action="#" method="post" class="mb-0">
  42.                 <div class="mb-3">
  43.                     <input type="email" class="form-control" placeholder="Your email address" required>
  44.                 </div>
  45.                 <button type="submit" class="btn btn-primary w-100">Subscribe</button>
  46.             </form>
  47.         </div>
  48.     </div>
  49. </div>