文章列表模板,使用企业版的在线编辑模板功能,并复制以下代码即可:

<div class="post-list container">
    <div class="row">
        {% for item in this.Model.Articles %}
        <div class="col-md-4 post-item">
            <div class="thumbnail">
                {% if item.Url %}
                <a target="_blank" href="{% url this.Model.Widget.DetailPageUrl %}/{{item.Url}}.html">
                    <img src="{% url item.ImageThumbUrl %}" alt="{{item.Title}}">
                </a>
                {% else %}
                <a target="_blank" href="{% url this.Model.Widget.DetailPageUrl %}/post-{{item.ContentID}}.html">
                    <img src="{% url item.ImageThumbUrl %}" alt="{{item.Title}}">
                </a>
                {% endif %}
            </div>
            <div>
                <h4>
                    {% if item.Url %}
                    <a target="_blank" href="{% url this.Model.Widget.DetailPageUrl %}/{{item.Url}}.html">
                        {{item.Title}}
                    </a>
                    {% else %}
                    <a target="_blank" href="{% url this.Model.Widget.DetailPageUrl %}/post-{{item.ContentID}}.html">
                        {{item.Title}}
                    </a>
                    {% endif %}
                </h4>
                <p class="text-muted">
                    <span class="text-muted publish-date">
                        {{item.PublishDate | date: "%Y-%m-%d %H:%M"}}
                    </span>
                </p>
            </div>
        </div>
        {% endfor %}
    </div>
    {% if this.Model.IsPageable %}
    <ul class="pagination">
        {% if this.Pagin.PreLink %}
        <li>
            <a href="{{this.Pagin.PreLink}}">«</a>
        </li>
        {% else %}
        <li class="disabled">
            <a href="javascript:void(0)">«</a>
        </li>
        {% endif %}

        {% if this.Pagin.PageIndex >= 5 %}
        <li>
            <a>...</a>
        </li>
        {% endif %}
        {% for item in this.Pagin.PageLinks %}
        <li class="{% if item.IsCurrentPage %}active{% endif %}">
            <a href="{{item.Link}}">{{item.Index}}</a>
        </li>
        {% endfor %}

        {% if this.Pagin.AllPage | minus: this.Pagin.PageIndex > 5 %}
        <li>
            <a>...</a>
        </li>
        {% endif %}

        {% if this.Pagin.NextLink %}
        <li>
            <a href="{{this.Pagin.NextLink}}">»</a>
        </li>
        {% else %}
        <li class="disabled">
            <a href="javascript:void(0)">»</a>
        </li>
        {% endif %}
    </ul>
    {% endif %}
</div>

微信公众号