change widgets class depending on output of script #681
-
Is it possible to change the class on a widget depending if the output of that widget has "" or "some text inside" ?
So if the value of scratchpad is an empty string or "" then change the line |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes this is doable but it's not straight forward as you would think. This because one of the side effects/ feature of defpoll is that it cannot set its variable to an empty string if it's already set to something that isn't an empty string. To work around this problem you will probably need to edit your code like so:
but if you expect null to be one of the expected output you should change it accordingly. |
Beta Was this translation helpful? Give feedback.
Yes this is doable but it's not straight forward as you would think. This because one of the side effects/ feature of defpoll is that it cannot set its variable to an empty string if it's already set to something that isn't an empty string. To work around this problem you will probably need to edit your code like so: