Streaming live at 10am (PST)

Add CSS class to a div based on a CMS setting

I can’t figure out how to do this so not sure if it’s possible but fingers crossed it is.

Based on a setting in the CMS, say a Switch for example I know how to show or hide a div. What I’d like to do however, is effect the appearance of a div. For example, by setting the Switch to On, I’d like to add a class named “highlight” to a div which will essentially add a border.

Is this possibel?

1 Like

As a possible work around you could have an element that looks exactly like you want, but only show up when the switch is active, and you do the inverse for the original element that you are emulating (like if it is a header you hide it when the switch is on, and you set the highlighted header to show up when the switch is on).

1 Like