I want to add a custom color scheme which will become activated by using a Choice dropdown in the edit section of the website. When they click "Purple" the color scheme changes to purple etc. The CSS is already set up, I just need to add a class in the body depending on the theme the user chooses. This is the code right know:
As of right know the if statements does not work because the 'root-theme' class is always acivated despite what is chosen in the Edit section. How can I go about to add the right class, depending on choice?
The variable you want for grabbing the data is {{ widget_data.theme.value }}. You can also cut down on the code by using a [value, label] setup in your choice field, with the value being your class. That way instead of having an if statement you can just put the value directly into the class. Like so:
Choice (use the choice tag, the choice module seems to be deprecated)
The variable you want for grabbing the data is {{ widget_data.theme.value }}. You can also cut down on the code by using a [value, label] setup in your choice field, with the value being your class. That way instead of having an if statement you can just put the value directly into the class. Like so:
Choice (use the choice tag, the choice module seems to be deprecated)