Log in
Log into community
Join the Webstudio community
View all posts
Related posts
Was this helpful?
๐
๐
๐
Powered by
Hall
Active
Updated 4 weeks ago
0
Follow
Code logic on URL Query String
Code logic on URL Query String
Active
0
Follow
H
Hero
8 months ago
ยท
It would be highly useful to me if I could read a querystring param and use code logic with it.
For example, depending on the value...
Show or hide elements.
Set an element's text value
Change an element's background color
Change an img src
B
H
O
6 comments
Share
Open in Discord
B
Bogdan
8 months ago
Hey, you can already access search params with "system" variable
H
Hero
8 months ago
I saw that I can access them. I just haven't found any way to conditionally act on them. If p1 = x, do a; if p1=y, do b, if p2=m, do c, etc.
H
Hero
8 months ago
Hopefully I'm just missing something.
B
Bogdan
8 months ago
there is "show" setting in every instance you can bind condition with system variable to it
B
Bogdan
8 months ago
Or you can bind ternary operator with system variable to image src
O
Oleg Isonen
8 months ago
Example expression that returns true or false and shows/hides the instance
system.search.something == 'something'
Add a reply
Sign up and join the conversation on Discord
Join on Discord