I'm working on a blog template that would allow the publisher to show an image gallery module on a per post basis. In the head of the template I've placed this code:
The template had an existing HubSpot Image Gallery module. I added this wrapper to the module:
{% if widget_data.gallery_toggle.value == true %} <!-- HTML to show when checked --> {{ html }} {% else %}
{% endif %}
The code works to show or hide the image gallery. The issue I'm facing is that the images already added disappear! I've reached out to the HubSpot support team and they recommended I post my issue here to see if anybody has seen this bug or has a solution.
from the head of the template. This option is "side-wide" so this is the part which "deletes" the images after you disable it.
Have you tried to change the existing module or write a new one?
this is basicly the same thing:
{% if module.show_gallery == true %}
<!-- HTML to show when checked -->
{% elif %}
<!-- HTML to show when NOT checked -->
{% endif %}
a simple bowlesh widget in the module
Note: the elif-part is not nessesary since you want to just turn it on or off.
Furthermore I would suggest to build the module with some repeater-widgets so you don't have to generate multiple widgets with (nearly) the same content...