templates/VisualMediaBlogBundle/views/Blog/blog_category.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: [ category ] } %}
  4.     <div id="blog_category" class="container">
  5.         {% include '@VisualMediaBreadcrumb/Breadcrumb/breadcrumb_static.html.twig' with { breadcrumbs: [
  6.             { title: page.title, path: path('blog_index') },
  7.             { title: category.title },
  8.         ] } only %}
  9.         <h1>{{ category.title }}</h1>
  10.         {{ category.htmlContent|scan }}
  11.         <hr>
  12.         {% if posts is not empty %}
  13.             <div class="row">
  14.                 {% for post in posts %}
  15.                     <div class="col-4 mb-4">
  16.                         {#
  17.                         {% for test in post.mainCategory.posts %}{% endfor %}
  18.                         {{ dump(post.mainCategory) }}
  19.                         #}
  20.                         <h2><a href="{{ path('blog_post', { categorySlug: post.mainCategory.slug, postSlug: post.slug }) }}">{{ post.title }}</a></h2>
  21.                         <span>Gepubliceerd op: {{ post.publicationDate|date('d-m-Y') }}</span>
  22.                         <div class="intro-text">
  23.                             {% set max = 150 %}
  24.                             {% set content = post.htmlContentIntro|scan %}
  25.                             {{ (content|length > max ? content|slice(0, max) ~ '...' : content)|raw }}
  26.                         </div>
  27.                         <a href="{{ path('blog_post', { categorySlug: post.mainCategory.slug, postSlug: post.slug }) }}">
  28.                             <img src="{{ post.upload|url }}" style="width: 100%; height: 250px; object-fit: cover;">
  29.                         </a>
  30.                     </div>
  31.                 {% endfor %}
  32.             </div>
  33.         {% else %}
  34.             <p>Er zijn geen berichten gevonden...</p>
  35.         {% endif %}
  36.     </div>
  37. {% endblock %}