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:
INSIDE THE HEAD TAG:
{% choice "theme" label="Select a theme", value='Purple', choices='Yellow, Purple, Green', export_to_template_context="True" %}
or referring to an actual module (this hasn’t worked for me and is hidden in the code):
{# {% module "module_166746683164613" path="/template-masterplan/modules/theme-picker", label="Purple", export_to_template_context=True %} #}
BELOW THE HEAD TAG, after </head>:
{% if widget.value == "Purple" %}<body class="theme-purple_haze">{% elif widget.value == "Green" %} <body class="theme-green_hell">{% else widget.value == "Yellow" %} <body class="root-theme">{% endif %}
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?