APIs & Integrations

Not applicable

Want to know the procedure for showing dynamic content ( blog posts ) in static HTML template

SOLVE

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.

0 Upvotes
1 Accepted solution
narayan007
Solution
Member

Want to know the procedure for showing dynamic content ( blog posts ) in static HTML template

SOLVE
<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 %}

View solution in original post

7 Replies 7
narayan007
Member

Want to know the procedure for showing dynamic content ( blog posts ) in static HTML template

SOLVE

{{ rec_post.publish_date_local_time|datetimeformat(‘dd MMM , YYYY’) }}

Thanks,
Laxmi narayan

0 Upvotes
Not applicable

Want to know the procedure for showing dynamic content ( blog posts ) in static HTML template

SOLVE

Hi Laxmi_Narayan,

Thanks for the reply. I think my question is unclear :expressionless:

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.

0 Upvotes
narayan007
Member

Want to know the procedure for showing dynamic content ( blog posts ) in static HTML template

SOLVE

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

0 Upvotes
Not applicable

Want to know the procedure for showing dynamic content ( blog posts ) in static HTML template

SOLVE

Thanks a lot. Its working :slight_smile:

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.

0 Upvotes
narayan007
Solution
Member

Want to know the procedure for showing dynamic content ( blog posts ) in static HTML template

SOLVE
<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 %}
narayan007
Member

Want to know the procedure for showing dynamic content ( blog posts ) in static HTML template

SOLVE

You can use RSS in custom HTML module

0 Upvotes
Not applicable

Want to know the procedure for showing dynamic content ( blog posts ) in static HTML template

SOLVE

Can you please give one example, how can show?

Many thanks,
-Sabita.

0 Upvotes