Join the Webstudio community

Updated 7 months ago

Page with path that can accept multiple parameters

At a glance

The community members are discussing how to create a page that can accept any number of parameters in the URL path and store them in an array. The original poster provides an example where the URL "example.com/data/data2" would result in the "slug" array having "data" at index 0 and "data2" at index 1.

The comments suggest using the syntax "/:param1/:param2" to handle two parameters, and potentially extending it to "/:param1/:param2/.../:param100" to handle up to 100 parameters. One community member notes that this may be a "sloppy implementation" and suggests using the "/:name*" syntax instead, which can handle any number of parameters.

A community member also provides a link to external documentation about content management systems, which may be relevant to the discussion.

Useful resources
Is there a way to make a page that can accept any amount of parameters in the path and create an array? So for example if it's example.com/:slug and the url entered is example.com/data/data2, slug[0] would equal data and slug[1] would equal data2
O
S
6 comments
its just /:param1/:param2
I would need to make a page for how deep I allow? As in I would want it in theory to go to /:param100
Like /:param1/:param2/.../:param100
My reason for asking would be sloppy implementation, can disregard
distinct params are needed because you want access to each specific one, you don't seem to need it, you seem to want /:name*
Add a reply
Sign up and join the conversation on Discord