How to restrict a module from showing up in listing view

Hello everyone, this is my first post on this forum. I’m fairly familiar with CSS/HTML but I’m new to hubspot’s module and template system. Basically, I’m stumped at how to disable a sidebar module from showing up in our listing view, but allowing for it to show up on the single post view.

Here are some screenshots that could make my predicament clearer:


This is the problematic section. You can see the sidebar module on the right.

It shows up properly in single post view. This is what we want.

However, the sidebar also shows up in the listing view. This is what we don’t want.

If any kind soul could help or point me in the right direction, I would appreciate it so much. Thank you!

Hi @JDino. I know how to do this with HubL (not in a drag and drop):

{% unless is_listing_view %}

// your sidebar

{% endunless %}

I’m not sure how to add that to the drag and drop though. A simpler solution might be to have different templates for your listing page (without the sidebar) and blog post (with the sidebar).

In Drag and Drop you can click on the modules or wrappers you want hidden and place the unless statement in the Wrapping HTML field, with the {{ html }} tag between the statement.

Thank you very much! Worked like a charm.