Skip to content

Instantly share code, notes, and snippets.

@EddyVinck
Last active March 19, 2019 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EddyVinck/3c3ff9b1eedbc46444a3146bbb9f435b to your computer and use it in GitHub Desktop.
Save EddyVinck/3c3ff9b1eedbc46444a3146bbb9f435b to your computer and use it in GitHub Desktop.
{# in my_email_template.html #}
{# Notice use_header_logo={{use_header_logo}} in the module_block. #}
{# This is how the value is passed into the module. #}
{# It's important to explicitly check for false since the value can be null #}
{# When the client has not changed the boolean switches in 'Module Usage' #}
{# This is based on the assumption that the module is enabled by default. #}
<table>
<tr>
<td>
{% if module_usage.header == false %}
<!--[if !mso]><!-- -->
{% set use_header_logo = false %}
{% endif %}
<div class="widget-span widget-type-custom_widget">
<div class="layout-widget-wrapper">
{% if module_usage.header == null %}
{# it was null, setting use_header_logo to true.. #}
{% set use_header_logo = true %}
{% elif module_usage.header == true %}
{# it was true, setting use_header_logo to true.. #}
{% set use_header_logo = true %}
{% endif %}
{% module_block
module "module_1549"
module_id="612",
overrideable=True,
per_widget_wrapper_html='',
widget_name='Header',
wrapping_html='',
label='Header',
use_header_logo={{use_header_logo}}
%}
{% end_module_block %}
</div>
<!--end layout-widget-wrapper -->
</div>
{% if module_usage.header == false %}<!--<![endif]-->{% endif %}
<!--end widget-span -->
</td>
</tr>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment