Extracting widget_data from a global widget?



Is there any way to get the widget data from a global widget? My user case is that I want to have a simple menu as a global module and apply it to all my templates in a block syntax with a for each loop. I know how to do it on a specific template like so:

{% simple_menu "sub_navigation" overrideable=True, label='Sub Navigation', export_to_template_context=True % }

{% for item in widget_data.sub_navigation.menu_tree %}

<a href="{{ item.linkUrl }}">{{ item.linkLabel }}</a>

{% endfor %}

But how would I extract the widget_data from a global widget ({% global_widget “global_widget” %}?

Do any of you know a better way to apply a global simple menu for all templates whereby I avoid the default HubSpot markup?

Best regards,



Did you find the solution?