# Use boolean Tag with "export\_to\_template\_context='true""

**URL:** <https://community.hubspot.com/t/use-boolean-tag-with-export-to-template-context-true/24643>\
**Category:** CMS Development\
**Created:** [August 26, 2020, 9:47am UTC](https://community.hubspot.com/t/use-boolean-tag-with-export-to-template-context-true/24643 "2020-08-26T09:47:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![peesen](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/peesen/32/74736_2.png) [@peesen](https://community.hubspot.com/u/peesen)\
**Post date:** [August 26, 2020, 9:47am UTC](https://community.hubspot.com/t/use-boolean-tag-with-export-to-template-context-true/24643/1 "2020-08-26T09:47:03Z")

</div>

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

```lia-code-sample
 {% 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!

---

<div class="post-metadata">

**Author:** ![stefen](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/stefen/32/29274_2.png) [@stefen](https://community.hubspot.com/u/stefen)\
**Post date:** [August 26, 2020, 5:28pm UTC](https://community.hubspot.com/t/use-boolean-tag-with-export-to-template-context-true/24643/2 "2020-08-26T17:28:55Z")

</div>

@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:

```lia-code-sample
{% 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](https://developers.hubspot.com/docs/cms/building-blocks/modules/export-to-template-context)
