Use boolean Tag with "export_to_template_context='true""

Hi, i true to show a module in a custom template when a booean-tag is set true, but the code is not working

 {% boolean "partners_active" label='Show Partners', value=False, export_to_template_context=True %}
 {% if partners_active == true %}
 {% include "/my-folder/templates/template-parts/partners.html" %}
 {% endif %}

I dont know what i did wrong. Any help? Thank you so much!

@peesen when you use the export_to_template_context you have to call your field with the “widget_data” syntax. Your if statement should be:

{% if widget_data.partners_active.value %}
active!
{% endif %}

As long as you’re using that in a coded template it should work. If you’re trying to use it in a custom module or retrieve a field from a blog post in a blog listing, there is a different syntax. More info here: export_to_template_context - HubSpot docs