Join the Webstudio community

Updated 4 weeks ago

How do i make a base path a valid page

/online-casinos this path gives 404. is creating another copy of the page the only way to make this a valid path when no filters are supplied
Attachment
image.png
O
A
20 comments
no, you just need to treat these parts as optional when you are handling data
so when building a query based on path, provide a default value for when that parameter not available
but /online-casinos/ gives me a 404 page not missing data
if i navigate to the page using href page it takes me to this path /online-casinos/:filtertype/:filter
i would assume if /online-casinos existed i would just be redirected to a page with no data but to get to that stage i have to go to /online-casinos/:filtertype/:filter if i redirect manually to /online-casinos it doesnt exist
as you can see here from one of the tuts the process is to have a dupe page. but my page is basically the same so it means a lot of copy and paste especially as the slot system doesnt support system vars yet
Attachment
image.png
how do you test?
I believe it will give you 404 if data is missing too
published and set data
or because your query doesn't deliver data and your expression tries to use something that doesn't exist, so it crashes
what happens in the builder if you don't supply the params?
just gives me blank
Attachment
image.png
/online-casinos/:filtertype/:filter just like going here
yeah im using the syntax
Attachment
image.png
i dont see a solution unless i create a dupe page
see the docs, for optional params
ok got ya :xxx? πŸ˜„
noticed when using 2 optional filters the page href will keep the first one. i can work around this with a link just wondering if its a bug or a limitation
Attachments
image.png
image.png
image.png
may be a bug actually
Add a reply
Sign up and join the conversation on Discord