# Custom Module not appearing in certain templates

**URL:** <https://community.hubspot.com/t/custom-module-not-appearing-in-certain-templates/4001>\
**Category:** CMS Development\
**Created:** [November 27, 2017, 10:22am UTC](https://community.hubspot.com/t/custom-module-not-appearing-in-certain-templates/4001 "2017-11-27T10:22:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikki\_ROBIN](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/nikki_robin/32/69081_2.png) [@Nikki\_ROBIN](https://community.hubspot.com/u/Nikki_ROBIN)\
**Post date:** [November 27, 2017, 10:22am UTC](https://community.hubspot.com/t/custom-module-not-appearing-in-certain-templates/4001/1 "2017-11-27T10:22:51Z")

</div>

Hello everyone,

I’ve made a custom module for my blog pages, which shows the most recent page containing a certain topic. I have two templates in which this custom module is shown, the blog post template and the blog template itself.

The custom module looks great in the blog post template, but it doesn’t appear in the blog template. I don’t know if this is enough info, but below you can see the template with the custom module (postlisting (kort nieuws)).

 ![Schermafbeelding 2017-11-27 om 11.20.05.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/0/b/0b8f6bd963fe2e4ecd0a0e9f38e67b7aab181804.png)  
Template Blog Post (working)  
 ![Schermafbeelding 2017-11-27 om 11.19.57.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/5/1/51d74e0dd43080c289936a06c2d81900e375795e.png)  
Template Blog (not working)

Any help is appreciated!

---

<div class="post-metadata">

**Author:** ![TRooInbound](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/trooinbound/32/89545_2.png) [@TRooInbound](https://community.hubspot.com/u/TRooInbound)\
**Post date:** [November 27, 2017, 2:36pm UTC](https://community.hubspot.com/t/custom-module-not-appearing-in-certain-templates/4001/2 "2017-11-27T14:36:42Z")

</div>

Hi [@Nikki\_ROBIN](https://community.hubspot.com/t5/user/viewprofilepage/user-id/14520),

As blog structure contains HubL code which is not displayed right now, so we can’t figure out the issue, can you provide limited access/scrren share, so we can look into it and resolve issue as soon as possible. or you can mail us on **[hello@trooinbound.com](mailto:hello@trooinbound.com).**

Team TRooInbound!

---

<div class="post-metadata">

**Author:** ![Nikki\_ROBIN](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/nikki_robin/32/69081_2.png) [@Nikki\_ROBIN](https://community.hubspot.com/u/Nikki_ROBIN)\
**Post date:** [November 27, 2017, 2:38pm UTC](https://community.hubspot.com/t/custom-module-not-appearing-in-certain-templates/4001/3 "2017-11-27T14:38:57Z")

</div>

Hi there, thanks so much for your reply.

This is the code inside the custom module. Does that help?

{% if content.topic\_list %}  
\<h3\>Kort nieuws\</h3\>  
{% for topic in content.topic\_list %}  
{% if loop.first %}  
{% set related\_posts = blog\_recent\_topic\_posts(‘Kort nieuws’, topic.slug, 5 ) %}  
{% for post in related\_posts %}  
{% unless content.absolute\_url == post.absolute\_url %}  
\<ul class=“related-post-item”\>  
\<li class=“related-title”\>\<a href=“{{post.absolute\_url}}”\>{{ post.name}}\</a\>\</li\>  
\</ul\>  
{% endunless %}  
{% endfor %}  
{% endif %}  
{% endfor %}  
{% endif %}

---

<div class="post-metadata">

**Author:** ![TRooInbound](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/trooinbound/32/89545_2.png) [@TRooInbound](https://community.hubspot.com/u/TRooInbound)\
**Post date:** [November 27, 2017, 2:59pm UTC](https://community.hubspot.com/t/custom-module-not-appearing-in-certain-templates/4001/4 "2017-11-27T14:59:21Z")

</div>

Hi [@Nikki\_ROBIN](https://community.hubspot.com/t5/user/viewprofilepage/user-id/14520),

We think the issue is due to the filter you applied, Instead of ‘Kort nieuws’ you may need to replace with the blog ID of that blog.

You can select your blog from:

**Content \> Blog \> Select your particular blog from dropdown**

Below is attached screenshot where blog ID is highlighted from where you got your blog id.

 ![Capture.PNG](https://d2qpr2jzcazej7.cloudfront.net/original/2X/8/88e37a13d3317b808891a4989a609dc809048302.png)

We hope it works for you.

Team TRooInbound.

---

<div class="post-metadata">

**Author:** ![Nikki\_ROBIN](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/nikki_robin/32/69081_2.png) [@Nikki\_ROBIN](https://community.hubspot.com/u/Nikki_ROBIN)\
**Post date:** [November 27, 2017, 3:08pm UTC](https://community.hubspot.com/t/custom-module-not-appearing-in-certain-templates/4001/5 "2017-11-27T15:08:17Z")

</div>

Hello!

Thank you for the suggestion.

I’ve tried it, but it unfortunately doesn’t work. The filter ‘kort nieuws’ is by the way rather important, because those are the only blogs that are supposed to be listed.

---

<div class="post-metadata">

**Author:** ![Nikki\_ROBIN](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/nikki_robin/32/69081_2.png) [@Nikki\_ROBIN](https://community.hubspot.com/u/Nikki_ROBIN)\
**Post date:** [November 27, 2017, 3:19pm UTC](https://community.hubspot.com/t/custom-module-not-appearing-in-certain-templates/4001/6 "2017-11-27T15:19:07Z")

</div>

To be honest, I think it’s just not possible this way.

I created this custom module with this guide: [Creating a related blog post listing with the blog related posts HubL tag - HubSpot docs](http://designers.hubspot.com/tutorials/creating-a-related-post-section-with-hubl)

And in this guide it specifically says ‘related blog posts for inside you blog post template’.

I think that’s why it doesn’t work on my blog template.

If anyone’s knows a way to create a blog listing module, filtered to show only blogs with a certain topic, I’d love to hear it.

---

<div class="post-metadata">

**Author:** ![TRooInbound](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/trooinbound/32/89545_2.png) [@TRooInbound](https://community.hubspot.com/u/TRooInbound)\
**Post date:** [November 27, 2017, 3:44pm UTC](https://community.hubspot.com/t/custom-module-not-appearing-in-certain-templates/4001/7 "2017-11-27T15:44:04Z")

</div>

Hi [@Nikki\_ROBIN](https://community.hubspot.com/t5/user/viewprofilepage/user-id/14520),

Yes, We are just trying that out. On blog posting, there is no meaning of the related post. It is relevant to blog posting page only.

We think you are looking for the filtering post items in post listing page, you need to add your topic name as a second option in **blog\_recent\_topic\_posts** method as per below code

```auto
{% set topic_posts = blog_recent_topic_posts('default', 'your-topic', 5) %}
{% for topic_post in topic_posts %}
 <div class="post-title">{{ topic_post.name }}</div>
{% endfor %}

```

**Note:**  **It accepts a lowercase hyphenated name.**  **For eg. topic name is lead generation then need to add parameter as ‘lead generation’.**

We hope it works for you.

Team TRooInbound!

---

<div class="post-metadata">

**Author:** ![Nikki\_ROBIN](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/nikki_robin/32/69081_2.png) [@Nikki\_ROBIN](https://community.hubspot.com/u/Nikki_ROBIN)\
**Post date:** [November 27, 2017, 3:45pm UTC](https://community.hubspot.com/t/custom-module-not-appearing-in-certain-templates/4001/8 "2017-11-27T15:45:31Z")

</div>

Thank you for helping me!

I actually fixed it with a different solution. I created a specific tag (kort nieuws) RSS feed and that solved it.
