I have the following Custom HTML Properties defined:
{
"groups": [
{
"title": "SWITCH TEST",
"icon": "switch.2",
"properties": [
{
"title": "Test Switch",
"property": "testSwitch",
"switch": {
"trueValue": "ONE",
"falseValue": "ZERO",
"default": false
}
},
{
"information": {},
"title": "[Displays when FALSE]",
"visible": "!testSwitch"
},
{
"information": {},
"title": "[Displays when TRUE]",
"visible": "testSwitch"
},
]
}
]
}
I can’t get the appropriate information text to display when I toggle the switch in the properties pane, no information text displays whether the switch is True or False.
Am I doing something wrong (most likely ) or is it a bug?
upssjw
(Steve W)
8 August 2024 11:43
2
not sure if this will help I used this to toggle overflow off and on
Html
overflow-{{displayoff}}
Properties
{
“title”: “Visible”,
“id”: “displayoff”,
“switch”: {
“trueValue”: “block”,
“falseValue”: “hidden”,
“default”: true
}
},
This is what isn’t working for me:
{
"information": {},
"title": "[Displays when FALSE]",
"visible": "!testSwitch"
},
{
"information": {},
"title": "[Displays when TRUE]",
"visible": "testSwitch"
},
It should display the first information text or the second information text in the right hand properties panel, depending on the state of the “testSwitch" property and “visible” property test.
trinube
(Kim)
8 August 2024 13:03
4
Not sure if this is related but could be - Banner visibility - #2 by dan
upssjw
(Steve W)
8 August 2024 13:05
5
is this what you are trying to do
https://we.tl/t-LSWK98S9aF
links do not download and open for me
create html component
copy to html
create html component
copy to html
<div class="text-black text-center">{{display1}}
</div>```
copy below to properties
{
"groups": [{
"title" : "Main Area",
"properties" : [
{
"title": "Visible",
"property": "display1",
"switch": {
"trueValue": "Hello",
"falseValue": "Goodbye",
"default": true
}
},
]
}
]
}
upssjw
(Steve W)
8 August 2024 13:29
7
dan
(Dan C.)
8 August 2024 13:32
8
Hey @logrunner
The code below will display and hide other controls in the inspector based on the state of the switch. Let me know if you need anything else!
{
"groups": [
{
"title": "SWITCH TEST",
"icon": "switch.2",
"properties": [
{
"title": "Test Switch",
"property": "testSwitch",
"switch": {
"trueValue": true,
"falseValue": false,
"default": false
}
},
{
"information": {},
"title": "I'm False",
"visible": "testSwitch == false"
},
{
"information": {},
"title": "I'm True",
"visible": "testSwitch == true"
},
]
}
]
}
1 Like
@upssjw - Thanks for taking the time and effort to try and understand and resolve my issue.
@dan - I think I was led astray by the “visible” documentation that states:
3. Negation to Hide Elements
"visible": "!mySwitchControl"
It is all working now, thanks.
1 Like