CMS Development

andleymedia
Participant

HubL breaks image galleries

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:

 {% boolean "gallery_toggle" label='Show Image Gallery', value=False, no_wrapper=True, export_to_template_context=True %}

 

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.

0 Upvotes
2 Replies 2
MFrankJohnson
Thought Leader

HubL breaks image galleries

Was this issue ever resolved?

 

Thanks in advance.

 

Best,

Frank

#nlmtu

 

Note: Please search for recent posts as HubSpot evolves to be the #1 CRM platform of choice world-wide.

 

Hope that helps.

 

Be well,
Frank


www.mfrankjohnson.com
0 Upvotes
Anton
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

HubL breaks image galleries

Hi @andleymedia,

what template do you use? Is it a free one? Could you provide a preview link(not the Dev-preview link)?

 

 

 

Delete 

 {% boolean "gallery_toggle" label='Show Image Gallery', value=False, no_wrapper=True, export_to_template_context=True %}

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 modulea 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...

 

 

Please let me know if you need some help

 

 

regards

Anton

Anton Bujanowski Signature