So I've been trying to get the value from a text-field in a html-template into a <style>-tag. However when I try to retrieve the value I only get 0.
<!--The text module I want to get value from.-->
{% text "background-opacity" label="Background Opacity", value="heihei" export_to_template_context=True %}
<!--How I'm trying to use the value-->
<style>
.header img{
opacity: {{ widget_data.background-opacity.value }} !important;
}
</style>
In inspect mode on .header img i get:
opacity: 0 !important;
This happens no matter what I do. I've tried to put the value into a h1 tag as well. I only get a 0 then as well. It does'nt show up on the page in the h1 tag either. It's more like it's null and not 0.