We use cookies to make HubSpot's community a better place. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).
Feb 4, 2018 10:44 PM
Hi there,
We currently have footer hubspot template.
We have a Blog, we want to show blog posts in hubspot footer. How can we show the dynamic content in footer middle section?
Can you please advice?
Many thanks,
-Sabita.
Solved! Go to Solution.
Feb 5, 2018 2:09 AM
<div class="recent-posts-item">
{% set rec_posts = blog_recent_posts(your_blog_portal_id, No. Of posts to show) %}
{% for rec_post in rec_posts %}
<a href="{{rec_post.absolute_url}}" class="custom-post-item">
<div class="custom-post-item-inner" >
<div class="features-image-block" style="background-image:url( {{ rec_post.post_list_summary_featured_image }});">
</div>
<div class="custom-post-body clearfix">
<!--post summary-->
<h2>{{ rec_post.name }}</h2>
<span class="author-hubspot" data-hubspot-form-id="author_data" data-hubspot-name="Blog Author">
{{ rec_post.publish_date_local_time|datetimeformat('dd MMM YYYY') }}
</span>
</div>
</div>
</a>
{% endfor %}
Feb 5, 2018 3:51 AM
{{ rec_post.publish_date_local_time|datetimeformat(‘dd MMM , YYYY’) }}
Thanks,
Laxmi narayan
Feb 5, 2018 2:40 AM
Hi Laxmi_Narayan,
Thanks for the reply. I think my question is unclear
We have one hubspot id and there we have blogs. For one blog footer I want to show recent posts in that blog. And we have html template for the footer (attached image)
So there how can we show dynamic content.
Thanks,
-Sabita.
Feb 5, 2018 2:41 AM
basically you need only one post, right?
If you open blog in dashboard it will show you the blog id in url blogs/*******/manage/
That you need to update in code and you can use 1 in
{% set rec_posts = blog_recent_posts(*****, 1) %}
and it will show only one post which one is recent once, please let me know if you still have an issue
Feb 5, 2018 3:39 AM
Thanks a lot. Its working
I used following for the author_name and published date.
by {{rec_post.blog_author}} on {{rec_post.publish_date}}
Can you please suggest, how can I format date in ‘on 24 November, 2017’ format?
Thanks
-Sabita.
Feb 5, 2018 2:09 AM
<div class="recent-posts-item">
{% set rec_posts = blog_recent_posts(your_blog_portal_id, No. Of posts to show) %}
{% for rec_post in rec_posts %}
<a href="{{rec_post.absolute_url}}" class="custom-post-item">
<div class="custom-post-item-inner" >
<div class="features-image-block" style="background-image:url( {{ rec_post.post_list_summary_featured_image }});">
</div>
<div class="custom-post-body clearfix">
<!--post summary-->
<h2>{{ rec_post.name }}</h2>
<span class="author-hubspot" data-hubspot-form-id="author_data" data-hubspot-name="Blog Author">
{{ rec_post.publish_date_local_time|datetimeformat('dd MMM YYYY') }}
</span>
</div>
</div>
</a>
{% endfor %}
Feb 5, 2018 1:49 AM
You can use RSS in custom HTML module
Feb 5, 2018 2:00 AM
Can you please give one example, how can show?
Many thanks,
-Sabita.