CMS Development

CatSynth12345
Member

I am using the new Hubspot recommended post listing module- How can I edit how it looks?

I am using the new module, but want to make the featured image display as a link and ad spacing between posts.

The code that the module comes with (pluss two minor changes) including making image true, reads as such.

 

{% if module.select_blog is number %}
{% set select_blog = module.select_blog %}
{% else %}
{% set select_blog = 'default' %}

 

{% endif %}

<h3> Recommended Posts</h3>
<div class="right-blockblog-recommended">
{% post_listing
select_blog='{{ select_blog }}',
listing_type='recommended'
include_featured_image='true',
list_title='{{ module.list_title }}',
max_links={{ module.max_links }}
%}
</div>

 

 

How can I edit how the image looks? 

Please help! 

 

0 Upvotes
3 Replies 3
Jsum
Key Advisor

I am using the new Hubspot recommended post listing module- How can I edit how it looks?

Reorganizing/rearranging html markup using css is a hellish trick known only to **bleep**, and developers who don't have to ask. I wouldn't recommend it.

 

Instead you should just build your own rss feed. 

{% set rec_posts = blog_recent_posts('default', 5) %}
{% for rec_post in rec_posts %}
    <div class="post-title">{{ rec_post.name }}</div>
{% endfor %}

This function can be found in the HubL reference for functions. You can structure the html anyway you'd like, and add the blog components same way that you would for with blog markup. This gives you complete control over how your blog feeds look. You can place this in a custom module, a custom HTML module, or a custom HUBL module.

0 Upvotes
ATA-Daniel
Participant | Partner
Participant | Partner

I am using the new Hubspot recommended post listing module- How can I edit how it looks?

Hello @Jsum,

I was going to give this recommended post module a whirl if i could get it to show the post image and some other styling to match what we've already got going on our blog. Your response cites the blog_recent_posts function... but i didn't see a function for recommended posts in the HubL reference link you provided. I saw the blog_popular_posts as well, but not one for "recommended" posts. In HubSpot Announcement about this new module, it suggests the following:

  • The new recommended posts module uses data to determine which blog content will be most relevant to each specific visitor, and displays only those posts to them. Think: the most popular post they haven’t seen, or a post about a topic they’re interested in, or one by an author that they’ve frequented.

So am I wrong to think that there would be a single function that would take care of the voodoo suggested?

 

Please advise when you get a sec... and thank you for your help.

Cheers.

Dani

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

I am using the new Hubspot recommended post listing module- How can I edit how it looks?

@ATA-Daniel, you could add a topic "recommended" and pull from there

<div class="recommended-outer">
{% set topic_posts = blog_recent_topic_posts('default', 'recommended', 3) %}    // add recommended to blog topics
    {% for topic_post in topic_posts %}
    <div class="recommended-single">
            // add all of that sweet markup goodness in here
    </div>
    {% endfor %}      
</div>