Lorthirk
Member
Hello,
I have an HTML widget in which I need to identify if I am in a dark or light template, in order to set some colors to pass via query string to a third party script. So I'm doing something like
Unfortunately... it doesn't seem to work. At least, by trying to print {$xf.style.properties.styleType} returns empty; I don't know if there's something else as well...
Any help would be greatly appreciated!
I have an HTML widget in which I need to identify if I am in a dark or light template, in order to set some colors to pass via query string to a third party script. So I'm doing something like
HTML:
<div id="my_widget" style=""> </div>
<xf:if is="$xf.style.properties.styleType == 'light'">
<xf:set var="$textColor1" value="333333"></xf:set>
<xf:elseif is="$xf.style.properties.styleType == 'dark'" />
<xf:set var="$textColor1" value="dddddd"></xf:set>
<xf:else />
<xf:set var="$textColor1" value="888888"></xf:set>
</xf:if>
<script>
var my_var = "https://www.myservice.com/service.php?ID=12345678&text={$textColor1}&...
</script>
Unfortunately... it doesn't seem to work. At least, by trying to print {$xf.style.properties.styleType} returns empty; I don't know if there's something else as well...
Any help would be greatly appreciated!
Last edited: