templates/VisualMediaBlogBundle/views/Blog/blog_index.html.twig line 1

Open in your IDE?
  1. {% extends 'Layout/base.html.twig' %}
  2. {% block main %}
  3.     {% include '@VisualMediaVisual/Visual/visual.html.twig' with { visuals: page.visuals } %}
  4.     <div id="blog_index" class="container">
  5.         {% include '@VisualMediaBreadcrumb/Breadcrumb/breadcrumb_static.html.twig' with { breadcrumbs: [
  6.             { title: page.title },
  7.         ] } only %}
  8.         <h1>{{ page.title }}</h1>
  9.         {{ page.htmlContent|scan }}
  10.         <hr>
  11.         {% if categories is not empty %}
  12.             <div class="row">
  13.                 {% for category in categories %}
  14.                     <div class="col-4 mb-4">
  15.                         <h2><a href="{{ path('blog_category', { categorySlug: category.slug }) }}">{{ category.title }}</a></h2>
  16.                         <span>Aantal berichten: {{ category.getPosts()|length }}</span>
  17.                         <div class="intro-text">
  18.                             {% set max = 150 %}
  19.                             {% set content = category.htmlContent|scan %}
  20.                             {{ (content|length > max ? content|slice(0, max) ~ '...' : content)|raw }}
  21.                         </div>
  22.                         <a href="{{ path('blog_category', { categorySlug: category.slug }) }}">
  23.                             <img src="{{ category.upload|url }}" style="width: 100%; height: 250px; object-fit: cover;">
  24.                         </a>
  25.                     </div>
  26.                 {% endfor %}
  27.             </div>
  28.         {% else %}
  29.             <p>Er zijn geen categorieën gevonden...</p>
  30.         {% endif %}
  31.     </div>
  32. {% endblock %}