{% if template_data.related.mentions %}

Mentions

{% set blogs = template_data.related.mentions | map(attribute="foreignKey") | selectattr("isCorporateBlog") %} {% for blog in (blogs | sort(true, attribute="date")) %}

{{ blog.title }}

By {{ blog.author }}

{{ blog.date | human_date_filter }}

Read the blog
{% endfor %}
{% for type, items in template_data.related.mentions | map(attribute="foreignKey") | selectattr("isCorporateBlog", "ne", True) | groupby('type') %}

{{items|length}} {% if type in mention_types %} {{mention_types[type].singular if items|length == 1 else mention_types[type].plural}} {% else %} {{type}} {% endif%}

{% endfor %}
{% endif %}