Potential work around for having only one blog post template

HubSpot Employee

Hi Guys!

 

So I know it can be frustrating sometimes with the limitation of only having one blog post template to use for posts on a blog, sometimes you might want to add new modules to a blog post and only have it appear on that page or be able to choose to have it appear?

 

So I've encountered this a few times and had to come up with a workaround, so I found that we can use boolean logic on a module to add a toggle on/off switch which is very useful for our blog post template because it means that we can choose which pages certain modules appear on.

 

In order to do this we have to create a module that we can use, in this case the form module, So I cloned the module and added this code snippet to the module enclosing it's HTML inbetween:

{% if module.hide_show_section %}
	<!-- HTML to show when checked -->
{% endif %}

 

We then used a Boolean field to add our toggle so we can toggle the module on and off, I know this seems complicated so once again I created a video and walked you through every step of the process on how I created the module and how we can use it on the blog going forward here: Loom.

 

Any questions on this just let me know!

1 Reply 1
Occasional Contributor

Hi Mark, do you have a way to implement this solution on the blog sidebar? It seems we can't create a sidebar module as the "Post Filter" and "Post Listing" elements are not available to use in the module builder. 

Reply
0 Upvotes