E-Mail Template: Replace color codes in Dropdown Menu with Color Names | Community
Skip to main content
Level 2
August 20, 2024
Solved

E-Mail Template: Replace color codes in Dropdown Menu with Color Names

  • August 20, 2024
  • 2 replies
  • 2677 views

Hey guys, 

we are currently trying to optimize our e-mail template and are therefore using the possibilities Marketo gives us in coding and designing the HTML. 

 

 When defining variables, we also use a dropdown to give users the choice of a predefined background color: 

As you can see, the values users can choose from are the Color codes in HEX format. My question is: Is it possible for us to replace these codes with "color names", so users don't have to choose from a cryptic code but can instead choose the color they like? 

 

The code in our template inside the <head> Part currently looks like this: 

 
<meta class="mktoList" id="TDM-Background" mktoName="Background Color" values="#005F7F, #91397F, #002A49" mktoModuleScope="true">
 
Thank you in advance and best regards! 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

Some people add a /* CSS comment */ in front of the hex code.

2 replies

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
August 21, 2024

Some people add a /* CSS comment */ in front of the hex code.

Disha_Goyal6
Community Advisor
Community Advisor
August 21, 2024

Hi @artur92, I don't think there is a way to define color name. If we add color name then value will not render correctly.

 

SanfordWhiteman
Level 10
August 21, 2024

Did you read my comment? (And there’s another way, too: use a CSS variable in addition to the hex code.)

artur92Author
Level 2
August 21, 2024

Hi SanfordWhiteman, 

 

thanks for the tip with the comments, it works great! Simple and smart, just how I like it 🙂 

The other way does sound a little bit more complex, but just out of curiosity: How would I accomplish this with using CSS variables? 

 

Best regards