{% extends 'Layout/base.html.twig' %}
{% block main %}
{% include '@VisualMediaVisual/Visual/visual.html.twig' with { visuals: page.visuals } %}
<div id="blog_index" class="container">
{% include '@VisualMediaBreadcrumb/Breadcrumb/breadcrumb_static.html.twig' with { breadcrumbs: [
{ title: page.title },
] } only %}
<h1>{{ page.title }}</h1>
{{ page.htmlContent|scan }}
<hr>
{% if categories is not empty %}
<div class="row">
{% for category in categories %}
<div class="col-4 mb-4">
<h2><a href="{{ path('blog_category', { categorySlug: category.slug }) }}">{{ category.title }}</a></h2>
<span>Aantal berichten: {{ category.getPosts()|length }}</span>
<div class="intro-text">
{% set max = 150 %}
{% set content = category.htmlContent|scan %}
{{ (content|length > max ? content|slice(0, max) ~ '...' : content)|raw }}
</div>
<a href="{{ path('blog_category', { categorySlug: category.slug }) }}">
<img src="{{ category.upload|url }}" style="width: 100%; height: 250px; object-fit: cover;">
</a>
</div>
{% endfor %}
</div>
{% else %}
<p>Er zijn geen categorieën gevonden...</p>
{% endif %}
</div>
{% endblock %}