CMS Development

QBui
Member

How to show tags list in pagnition next previous of post detail

Hi,

In post detail, I need to show pagnition to move next post or previous post.

How can I do it please?

Here is my code

<div class="pagenavi-single">
  {% if content.previous_post_name %}
    <a href="/{{ content.previous_post_slug }}" class="page page_prev">
      <p class="btn-prev"><span>前の記事</span></p>
      <div class="info">
        {% if content.previous_post_featured_image %}
        <div class="img">
          <span class="c-lazybg thumb" rel="js-lazy" data-bg="{{ content.previous_post_featured_image }}"></span>
        </div>
        {% endif %}
        <div class="info__txt">
          <span class="date">{{ content.previous_post_publish_date | format_date('yyyy.MM.dd') }}</span>
          {% for tag in content.previous_post %}
            <span class="cate"><em>{{ tag.name }}</em></span>
          {% endfor %} 
        </div>
        <div class="info__ttl"><span>{{ content.previous_post_name }}</span></div>
      </div>
    </a>
  {% endif %}
  {% if content.next_post_name %}
    <a href="/{{ content.next_post_slug }}" class="page page_next">
      <p class="btn-next"><span>次の記事</span></p>
      <div class="info">
        {% if content.next_post_featured_image %}
        <div class="img">
          <span class="c-lazybg thumb" rel="js-lazy" data-bg="{{ content.next_post_featured_image }}"></span>
        </div>
        {% endif %}
        <div class="info__txt">
          <span class="date">{{ content.next_post_publish_date | format_date('yyyy.MM.dd') }}</span> 
          {% for tag in content.next_post_taglist %}
            <span class="cate"><em>{{ tag.name }}</em></span>
          {% endfor %} 
        </div>
        <div class="info__ttl"><span>{{ content.next_post_name }}</span></div>
      </div>
    </a>
  {% endif %}
</div>

 

0 Upvotes
2 Replies 2
kvlschaefer
Community Manager
Community Manager

How to show tags list in pagnition next previous of post detail

Hi @QBui,

 

Thanks for reaching out! 

 

Are you receiving a specific error when you input this code, or could you please specify your roadblock? Are the next pages not appearing in the template? Sharing a specific error you receive is a more efficient and direct approach to getting help with code from the HubSpot Community. 

 

Thank you,

Kristen  

0 Upvotes
QBui
Member

How to show tags list in pagnition next previous of post detail

Hi @kvlschaefer ,

It don't have error, it seems hubspot don't have variable like content.next_post_tag_list.

Do you have any suggestions for this?

Thank for you support,

Quan

 

0 Upvotes