Theme module templates

Boilerplate templates for the customizable module templates available when editing a custom Theme

blog - posts list

This template controls both the "list" view for the blog module subpages. This includes the blog root, archive pages and category pages.

{% if posts %}
    {% for post in posts %}
        <article itemscope="" itemtype="http://schema.org/BlogPosting">
            <h2 itemprop="name headline">
                <a href="{{ post.external_url or post.url(**post_url_params) }}" title="{{ post.title }}">{{ post.title }}</a>
            </h2>
            <p datetime="{{ post.date|datetimefmt(format='yyyy-MM-ddTHH:mm') }}" itemprop="datePublished dateModified">{{ post.date|datefmt(format='long') }}</p>
            {% if post.content %}
            <div itemprop="articleBody">
                {% if show_full_posts %}
                    {{ post.content|safe }}
                {% else %}
                    {% if post.featured_img %}
                        <p itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
                            <img alt="{{ post.title }}" src="{{ post.featured_img.src }}" style="{{ post.featured_img.style }}" itemprop="image"/>
                        </p>
                    {% endif %}
                    <p>{{ post.content|striptags|truncatewords_html(75) }}</p>
                    <p><a href="{{ post.external_url or post.url(**post_url_params) }}" title="{{ post.title }}">{% trans %}Read more{% endtrans %}..</a></p>
                {% endif %}
            </div>
            {% endif %}
        </article>
    {% endfor %}
    <div>
        {% if posts.has_previous() %}
            <a href="{{ posts.prev_link }}">{% trans %}Previous Page{% endtrans %}</a>
        {% endif %}
        {% if posts.has_next() %}
            <a href="{{ posts.next_link }}">{% trans %}Next Page{% endtrans %}</a>
        {% endif %}
    </div>
{% else %}
    <p>{% trans %}No posts have been added{% endtrans %}
{% endif %}

blog - post detail

This template controls the single post page for each blog post.

blog - recent posts

Widget used to show the recent posts on a site's blog. Normally used in footers or other parts of pages outside the main blog pages.

directory - cities_list

directory - countries_list

Basic list of countries

List of countries and the states/provinces

directory - sites_list

directory - statesprovs_list

Last updated

Was this helpful?