Hey guys,
I have this simple HubL custom module, that loads a different Global Group depending on the option you select:
{% if widget.header == "static-menu" %}
{% include 'generated_global_groups/3193221022.html' %}
{% elif widget.header == "dynamic-menu" %}
{% include 'generated_global_groups/3162082770.html' %}
{% elif widget.header == "med-services-menu" %}
{% include 'generated_global_groups/3970705183.html' %}
{% elif widget.header == "mba-services-menu" %}
{% include 'generated_global_groups/4046661496.html' %}
{% elif widget.header == "grad-services-menu" %}
{% include 'generated_global_groups/4102282733.html' %}
{% elif widget.header == "law-services-menu" %}
{% include 'generated_global_groups/4102272583.html' %}
{% elif widget.header == "college-services-menu" %}
{% include 'generated_global_groups/4182384903.html' %}
{% elif widget.header == "no-menu" %}
{% include 'generated_global_groups/5431720649.html' %}
{% endif %}
The problem I keep running into is that it doesn’t render correctly on the Front End. Here’s how the Global Group that’s supposed to be rendered looks like in the backend: https://d.pr/i/66GRJ6
Now, if this Global Group get’s rendered using the {% include %} syntax mentioned above, it doesn’t render the CTA module and the New Homepage Popup module correctly and it looks like this: https://d.pr/i/ZxiYsR
Curiously enough, it renders the module’s outer html and custom classes, but not the modules themselves.
Here comes the stranger part, if I include in the page the Global Group itself by adding it to the Page Template everything renders fine, here’s how it looks: https://d.pr/i/XM6pgb
I’ve tried discussing this with HubSpot support but they sent me here to the forum saying that this is beyond their scope. I’ve searched through the forum and found that the {% include %} syntax used in the Custom Module is the proper way of inserting Global Groups in a Custom Module using HubL.
Is there something I’m missing? It seems to me like this is a server error, has anyone experienced something similiar to this?
Hi @dennisedson ,
Thank you for your response. I tried your suggestion and I still get the same error. The Global Module doesn’t render correctly.
Is there any way to force the regeneration of the
generated_global_groups/4046661496.html
html for the Global Module? Could that be the issue?
Alex
The statement works, I’ve tested it.
And thank you for the suggestion about the last elif, but if I change the last elif to else I get this error and can’t publish the module:
1.Error:“custom_widget” is disabled in this context
This happens even if I remove the condition from the statement like so:
{% if widget.header == "static-menu" %}
{% include 'generated_global_groups/3193221022.html' %}
{% elif widget.header == "dynamic-menu" %}
{% include 'generated_global_groups/3162082770.html' %}
{% elif widget.header == "med-services-menu" %}
{% include 'generated_global_groups/3970705183.html' %}
{% elif widget.header == "mba-services-menu" %}
{% include 'generated_global_groups/4046661496.html' %}
{% elif widget.header == "grad-services-menu" %}
{% include 'generated_global_groups/4102282733.html' %}
{% elif widget.header == "law-services-menu" %}
{% include 'generated_global_groups/4102272583.html' %}
{% elif widget.header == "college-services-menu" %}
{% include 'generated_global_groups/4182384903.html' %}
{% else %}
{% include 'generated_global_groups/5431720649.html' %}
{% endif %}