Page 1 of 1
how to set true/false variables via url?
Posted: Thu Sep 08, 2022 10:09 am
by CStüben
Hi all,
i fail to set an exposed true/false variable via url. Neither does work...
?category_visible=1
?category_visible=true
?category_visible=wahr
?category_visible=t
?category_visible=w
What do i oversee?
Version is p2vr 6.1.15, osx 10.13.6
greetings from germany
Chris
Re: how to set true/false variables via url?
Posted: Thu Sep 08, 2022 4:18 pm
by deedee123
Hi,
isn't this what you need?
viewtopic.php?f=13&t=15454
david
Re: how to set true/false variables via url?
Posted: Sun Sep 11, 2022 6:09 pm
by CStüben
Hi david,
unfortunatley this doesn´t help.
Variables of type text i can set via the url, works perfect. If one variable, or multiple, i can set them via the url.
But logical variables that contain true or false, i see no effect on the variable.
Yes, all variables are exposed.
yes, all variables have theyr code in the html that reads. the url and does a pano.setVariableValue('category_visible', gelesenerwert);
This mechanism works for text variables, but not for logical variables, and too doesnt work for numerical variables.
greetings from germany
Chris
Re: how to set true/false variables via url?
Posted: Mon Sep 12, 2022 9:47 am
by deedee123
Hi,
Hmm, not entirely sure what you mean.
What i do is get the extvalue onload, with the "contains" parameter. so i can use all letters in the alphabet, and i guess numbers too, to output or change what i need. so for instance if extvalue contains "S" splash=true.
is that in the right direction?
Best,
david
Re: how to set true/false variables via url?
Posted: Thu Sep 15, 2022 11:19 am
by Hopki
Hi Chris,
Just checking, on the end of the URL you use #.
Looking at this post:
viewtopic.php?p=64984#p64984
When you use the CustomValue.ggt you only need to add the # then the variable.
The attached project:
- Screenshot 2022-09-15 at 10.14.05.png (27.89 KiB) Viewed 4155 times
Note the CustomValue.ggt, this is required for both projects.
Tested with a single node as well as a tour, in the example, there is a rectangle that has colour logic blocks.
end the URL with ...index.html#Red, this will show a red rectangle.
There are also Green and Blue conditions so just replace Red with Green or Blue to see the colours.
I used Pano2VR 7 b4a for testing.
Regards,