Hubspot – Modelo de blog

Hubspot – Modelo de blog

Modelo de blog, con validación para mostrar elementos en grilla de artículos.

{% for content in contents %} 
{% if loop.index<=1 %} 
<article class="article2">
    <div class="item" style="background-image: url({{ content.post_list_summary_featured_image }})">        
        <a href="{{content.absolute_url}}">
            <div class="content_image" style="background-image: url({{ content.post_list_summary_featured_image }});"></div>
        </a>
        <a href="{{content.absolute_url}}"><h3>{{ content.name }}</h3></a>
        <div>Por: {%if content.blog_post_author %}{{ content.blog_post_author.display_name }}{% endif %}</div>
<div class="date">{{ content.publish_date|datetimeformat('%b %e, %Y')|capitalize }}</div>
        <div>{% if content.topic_list %}{% for topic in content.topic_list %} {% if loop.index <=1 %} {{ topic.name }} {% endif %} {% endfor %} {% endif %}</div>

    </div>
</article>
{% endif %} 
{% if loop.index == 2 or loop.index == 3 or loop.index == 4 or loop.index == 5 or loop.index == 6 %}
<article class="article">
    <div class="item">
        <a href="{{content.absolute_url}}">
            <div class="">
                <img src="{{ content.post_list_summary_featured_image }}">
            </div>
        </a>
        <a href="{{content.absolute_url}}"><h3>{{ content.name }}</h3></a>
        <div>Por: {%if content.blog_post_author %}{{ content.blog_post_author.display_name }}{% endif %}</div>
        <div>{% if content.topic_list %}{% for topic in content.topic_list %} {% if loop.index <=1 %} {{ topic.name }} {% endif %} {% endfor %} {% endif %}</div>
    </div>
</article>
{% endif %} 
{% if loop.index == 6 %}
<article class="article">
    <a href=""><img src=""></a>
</article>
{% endif %} 

{% endfor %} 

{% if not simple_list_page %} 
{% set total_pages = contents.total_page_count %}
<!-- sets variable for total pages -->
{% set more_pages = total_pages - current_page_num %}
<!-- sets variable for how many more pages are past the current pages -->
{% if total_pages > 1 %}
<!--paginación-->
 {% if not simple_list_page %}
                {% set total_pages = contents.total_page_count %} <!-- sets variable for total pages -->
{% set more_pages = total_pages - current_page_num %} <!-- sets variable for how many more pages are past the current pages -->
{% if total_pages > 1 %}
<nav aria-label="Page navigation" id="nav_pagination">
<ul class="pagination">
{% if last_page_num %}
                    <li>
                      <a class="previous-posts-link" href="{{ blog_page_link(last_page_num) }}">
                        <span aria-hidden="true">&laquo; Anterior</span>
                      </a>
                    </li>
                {% endif %}
                    
                {% if next_page_num %}
                    <li>
                      <a class="next-posts-link" href="{{ blog_page_link(next_page_num) }}">
                        <span aria-hidden="true">Siguiente &raquo;</span>
                      </a>
                    </li>
                {% endif %}

{% endif %}
</ul>
</nav>
{% endif %}

Deja un comentario

diecisiete + uno =

Cerrar menú