{% load i18n wagtailcore_tags wagtailimages_tags puput_tags %}

<div class="row relatedPosts">
    <section class="box features">
        <h2 class="post_title">
            <span>{% trans 'Related Entries' %}</span>
        </h2>
        <div class="itemPosts">
            <div class="row">
                {% for related_entry in entry.related|slice:':4' %}
                    <div class="col-md-3">
                        <section class="box feature">
                            <div class="image-related">
                                {% image entry.header_image fill-800x240 as header_image %}
                                <img alt="{{ entry.header_image.title }}" src="{{ header_image.url }}">
                            </div>
                            <h3>
                                <a href="{% entry_url related_entry blog_page %}">{{ related_entry.title }}</a>
                            </h3>
                            <p>
                                {{ related_entry.body|richtext|truncatewords:20 }}
                            </p>
                        </section>
                    </div>
                {% endfor %}
            </div>
        </div>
    </section>
</div>
