That actually works, but the issue is, when you forward the email once received, all the hidden elements will appear again.
@Olivia Piper For clarification, you just ended up creating a module without the item rather than try to provide the hide functionality as a Local Variable? I am trying to give the option to hide a button in a hero module without creating a second module that doesn't have it. We already have so many modules in our one master template!
Hi Janine Willis,
I did use booleans within the modules, such as building a hero banner including a button with show/ hide functionality.
Here is some code you could use (if you are building your email with tables):
Place this in the <head> tag:
<meta class="mktoBoolean" id="showheroButton" mktoname="Show Hero Button?" default="true" false_value="none" true_value="table-cell" false_value_name="NO" true_value_name="YES" />
For the button, create a table within the main table of the module. Place the following in the surrounding <td> of the button table:
style="display:${showheroButton}"
You will also need to use the following CSS:
.none, .none table { mso-hide: all;}
This ensures that Outlook will hide the table correctly.
I hope this helps!
Hi Olivia, where did you place the ".none, .none table {mso-hide: all;}" CSS? I am trying to add some boolean variables to CTAs in an email template, and have struggled with the Outlook issue.
What I'm confused by is where you got the class name ".none"?
Thank you!
.none, .none table {mso-hide: all;} this should be inside the <style></style> tag with the <head> section.
<head>
(rest of the tags)
<style>
.none, .none table {mso-hide: all;}
</style>
</head>
Regarding your second query, What I'm confused by is where you got the class name ".none"?
It's from the meta tag with the name false_value="none"
<meta class="mktoBoolean" id="showheroButton" mktoname="Show Hero Button?" default="true" false_value="none" true_value="table-cell" false_value_name="NO" true_value_name="YES" />
I agree, it will hide the element but when we forward the email, it will show the hidden element again.