Change text color based on value

Orange Gorilla
23 Posts
Orange Gorilla posted this 07 May 2019

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 08 May 2019

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
23 Posts
Orange Gorilla posted this 08 May 2019

I use advanced custom field (cms block).

I use advanced custom field (cms block).
Support Team
Support Team posted this 08 May 2019

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
23 Posts
Orange Gorilla posted this 08 May 2019

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
23 Posts
Orange Gorilla posted this 10 May 2019

Someone?

Someone?
Support Team
Support Team posted this 11 May 2019

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
23 Posts
Orange Gorilla posted this 11 May 2019

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
23 Posts
Orange Gorilla posted this 11 May 2019

Already figured it out, thanks.

Already figured it out, thanks.
Support Team
Support Team posted this 12 May 2019

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