Email editor 2.0: have MktoBoolean accept an empty "true" value instead of for setting it to "true"

Email editor 2.0: have MktoBoolean accept an empty "true" value instead of for setting it to "true"

Hi All,

Here is a mktoBoolean variable declaration:

<meta class="mktoBoolean" id="TrackCTA" mktoname="Track CTA" default="true" false_value="mktNoTrack" true_value="" false_value_name="NO" true_value_name="YES" mktomodulescope="true"/>

with this one, class="${TrackCTA}" will render class="true", which can be troublesome are errorprone (imagine you have a .true class somewhere in your CSS...)

The doc reads

true_value: Value to be inserted when toggle is in ON position. True if omitted.

And not

True if left empty.

This is not good because il will insert a "true" word in places where an empty one would be preferable.

So I think is would be better if true_value="" would render nothing rather than "true", while the default would still be true is the parameter is omitted.

-Greg

Justin Cooperman

5 Comments
Justin_Cooperm2
Level 10

I like it, but you can always use a string variable as a workaround. I would just put it as lower priority.

Justin

Grégoire_Miche2
Level 10

Hi Justin,

In this use case, I need to toggle on / off the link tracking of a CTA. I cannot have the end user enter the "mktNoTrack" class manually, they will surely fail and create a mess

The way I have worked around it is that I have set the True value to "DummyClass" and I hope no one will create such a class it the email template CSS in the future

-Greg

SanfordWhiteman
Level 10 - Community Moderator

I'd think if you use a class name that would have to be escaped in CSS, no one will accidentally use it. Like class=":mktTrack:".

But you don't have to use the class name as the variable, you can use the attribute name:

<a href="http​://www.example.com/landing" ${TrackCTA}="mktNoTrack">Blah</a>

<meta

  class="mktoBoolean"

  id="TrackCTA"

  mktoname="Track CTA"

  default="true"

  false_value="class"

  true_value="data-class-notrack"

  false_value_name="NO"

  true_value_name="YES"

  mktomodulescope="true" />

Grégoire_Miche2
Level 10

Hi Sanford,

I like the ":mktTrak:"

for the other solution, it's elegant, but we have cases where there are some "real classes" also, so we need the class to be there.

-Greg

kh-lschutte
Community Manager
Status changed to: Open Ideas