Hi,
I was wondering if someone could help me figure out why the topic_list and the post_list_content in one of my modules only works with my current post template but not in my listing template. The section is called Ultimos Articulos. I know how functions and loops work in JS but am not very familiarized with the HUBL syntax. Would love some help if anyone has a chance to take a look.
Here’s the module’s code:
<div id=“latest-posts” class=“latest-post-wrapper”>
{% set pop_posts = blog_recent_posts(‘group.id’, 2) %}
<div class=“sidebar-title”>
<h3>Últimos Artículos</h3>
<div class=“border-top”>
</div>
</div>
<div class=“container”>
<div class=“f-cont”>
{% for pop_post in pop_posts %}
<div class=“latest-group”>
<div class=“pop-hs-featured-image-wrapper”>
<a href=“{{pop_post.absolute_url}}” title=“” class=“hs-featured-image-link”>
{% if pop_post.post_list_summary_featured_image %}
<div class=“bck-img” style=“background-image:url(‘{{ resize_image_url( pop_post.post_list_summary_featured_image,750, 750) }}’)”>
</div>
{# <img src=“{{ resize_image_url( pop_post.post_list_summary_featured_image,350, 350) }}” class=“hs-featured-image” alt=“{{ content.featured_image_alt_text }}”> #}
{% else %}
<img src=“https://www.mcoghlan.mx/hubfs/MCoghlan_April2018/images/logo.png” class=“hs-featured-image” alt=“{{ content.featured_image_alt_text }}”>
{% endif %}
</a>
</div>
{% if content.topic_list %}
<p id=“hubspot-topic_data”>
{% for topic in content.topic_list %}
<a class=“topic-link” href=“{{ group.absolute_url }}/topic/{{ topic.slug }}”>{{ topic.name }}</a>{% if not loop.last %},{% endif %}
{% endfor %}
</p>
{% endif %}
<a class=“recent-title” href=“{{pop_post.absolute_url}}”>{{ pop_post.name }} </a>
{# <div class=“date”>
<i class=“fa fa-clock-o”></i>
<font style=“vertical-align: inherit;”>
<font style=“vertical-align: inherit;”> {{ pop_post.publish_date_local_time.strftime(‘%B’) }} {{ pop_post.publish_date_local_time.strftime(‘%e’) }}, {{ pop_post.publish_date_local_time.strftime(‘%Y’) }}</font></font>
</div> #}
<div class=“blog-post-reading-time”>
{% set initialPostWords = content.post_body|wordcount %}
{% set calculatedPostWords = (initialPostWords/100) * 100 %}
{% set finishedPostWords = calculatedPostWords|divide(300)|round(2) %}
{% set number = finishedPostWords|round %}
Lectura de {{ finishedPostWords|round }} min
</div>
<div class=“post-content”>
<a class=“” href=“{{pop_post.absolute_url}}”> {{ content.post_list_content|truncatehtml(50, ‘…’, false)}} <img class=“arrow-hero” src="https://www.mcoghlan.mx/hubfs/Blog%20-%202020/icon-arrow.svg"></a>
</div>
</div>
{% endfor %}
</div>
</div>
</div>