CMS Development

Zoates27
Miembro

Blog_Ids Not Working

Hello, 

 

I am working on a custom Module to pull in specific blog posts into my landing page. I've had a couple of interactions with support without much success but it looks like the blog_ids to pull in specific blogs does not work. Has anyone else had this issue? I was told that https://app.hubspot.com/content-detail/405630/blog-post/63807941479/performance that the red section of the URL is each blogs unique blog_id but when I insert that into my code below, it does not render.

 

      {% related_blog_posts blog_ids="63807941479",
        limit=2,
        no_wrapper=True,
        post_formatter="recent_post"
      %}

 

Any help would be greatly appreciated! 

 

0 Me gusta
1 Respuesta 1
Anton
Experto reconocido | Partner nivel Diamond
Experto reconocido | Partner nivel Diamond

Blog_Ids Not Working

Hi @Zoates27

this code won't work in a custom module. this code will work only in templates and only outside of dnd_areas.

 

For a custom module you could achive it like this: 

 

{% set rec_posts = blog_recent_posts('default', 5) %} {# replace default with your blog id #}

{% for rec_post in rec_posts %} {# create a custom layout here #}
    <div class="post-title">{{ rec_post.name }}</div>
{% endfor %}

 

 

for more informations here's the link to the docu

 

best, 

Anton

Anton Bujanowski Signature