Change text color based on value

Orange Gorilla
20 Posts
Orange Gorilla posted this 2 weeks ago

Hi,

I would like to change the color based on a value.

For example:
when a text field / or value (text in CMS block) is "A", the background should be blue. When the value is "B" the background should be green.

How Can I create something like that with Themler?

Kind regards,

Hi, I would like to change the color based on a value. For example: when a text field / or value (text in CMS block) is "A", the background should be blue. When the value is "B" the background should be green. How Can I create something like that with Themler? Kind regards,
Vote to pay developers attention to this features or issue.
9 Comments
Order By: Standard | Newest
Support Team
Support Team posted this 2 weeks ago

Hello,
Could you please explain about the values? Where will they come from? Is it dynamic code?

Gina
Themler Support

Hello, Could you please explain about the values? Where will they come from? Is it dynamic code? Gina Themler Support
Orange Gorilla
20 Posts
Orange Gorilla posted this 2 weeks ago

I use advanced custom field (cms block).

I use advanced custom field (cms block).
Support Team
Support Team posted this 2 weeks ago

Please, provide the link to the page and describe where we can see those fields.

Gina
Themler Support

Please, provide the link to the page and describe where we can see those fields. Gina Themler Support
Orange Gorilla
20 Posts
Orange Gorilla posted this 2 weeks ago

It's about this page: http://gigmanager.orangegorilla.nl/
Third column. The value on this page is for 'Bevestigd', 'Optie' or 'B'.

Now i'm working with CMS blocks with a ACF code.

It's about this page: http://gigmanager.orangegorilla.nl/ Third column. The value on this page is for 'Bevestigd', 'Optie' or 'B'. Now i'm working with CMS blocks with a ACF code.
Orange Gorilla
20 Posts
Orange Gorilla posted this 2 weeks ago

Someone?

Someone?
Support Team
Support Team posted this 2 weeks ago

You can try using this code, but please note that I can only make the background of that field change (not entire row):

div[class*="populationc"] {
  background-color:red!important;
}

div[class*="populationa"] {
  background-color:green!important;
}

Gina
Themler Support

You can try using this code, but please note that I can only make the background of that field change (not entire row): div[class*="populationc"] { background-color:red!important; } div[class*="populationa"] { background-color:green!important; } Gina Themler Support
Orange Gorilla
20 Posts
Orange Gorilla posted this 2 weeks ago

Hi,

Thanks.
Do I have to add this code in the concerning Cms block?

Hi, Thanks. Do I have to add this code in the concerning Cms block?
Orange Gorilla
20 Posts
Orange Gorilla posted this 2 weeks ago

Already figured it out, thanks.

Already figured it out, thanks.
Support Team
Support Team posted this 2 weeks ago

Ok, good. But just in case: it can be added in Themler -> Home -> Settings -> Additional CSS or directly on the site to template.css.

Gina

Ok, good. But just in case: it can be added in Themler -> Home -> Settings -> Additional CSS or directly on the site to template.css. Gina
You must log in or register to leave comments