{% macro escapeText(text, dangerouslyDisableAutoEscaping=false) %} {% if dangerouslyDisableAutoEscaping %} {{ text | safe}} {% else %} {{ text }} {% endif %} {% endmacro %} {% macro escapeTitle(title, url, dangerouslyDisableAutoEscaping=false, showTitleAsUrl=false) %} {% if dangerouslyDisableAutoEscaping %} {% if showTitleAsUrl %} {{ title | safe }} {% else %} {{ title | safe}} {% endif %} {% else %} {% if showTitleAsUrl %} {{ title }} {% else %} {{ title }} {% endif %} {% endif %} {% endmacro %} {% if loaded %} {% if config.showAsList %} {% else %}
{% if (config.showSourceTitle and sourceTitle) or config.showPublishDate %}
{% if sourceTitle and config.showSourceTitle %} {{ escapeText(sourceTitle, config.dangerouslyDisableAutoEscaping) }}{% if config.showPublishDate %}, {% else %}: {% endif %} {% endif %} {% if config.showPublishDate %} {{ publishDate }}: {% endif %}
{% endif %}
{{ escapeTitle(title, url, config.dangerouslyDisableAutoEscaping, config.showTitleAsUrl) }}
{% if config.showDescription %}
{% if config.truncDescription %} {{ escapeText(description | truncate(config.lengthDescription), config.dangerouslyDisableAutoEscaping) }} {% else %} {{ escapeText(description, config.dangerouslyDisableAutoEscaping) }} {% endif %}
{% endif %}
{% endif %} {% elseif empty %}
{{ "NEWSFEED_NO_ITEMS" | translate | safe }}
{% elseif error %}
{{ "MODULE_CONFIG_ERROR" | translate({MODULE_NAME: "Newsfeed", ERROR: error}) | safe }}
{% else %}
{{ "LOADING" | translate | safe }}
{% endif %}