How do I create a page path with and without slash and extra text?

I have pages with the following path: https://website.com/place/[id] which currently works ok.

I’d like to now extend those pages with subpages of the form:
https://website.com/place/[id] (already exists)
https://website.com/place/[id]/report
https://website.com/place/[id]/summary
https://website.com/place/[id]/similar

I’m trying to figure out if there’s a way to do this all within one weweb page as opposed to recreating each separately. More specifically I’m trying to find a way to have both the path with id and not subsequent slashes with the paths with a trailing slash…

Has anyone in the community tried this successfully?

Nope. The best you can do is to use the ?query=parameters

1 Like

Maybe you can use two path variables, and make sections in your page for each subpage. Then use conditional rendering to show only the correct subpage.

image

1 Like

Tack så mycket for the idea. That was my first go to option too (both the two params and the conditionals).

The reason why I posted it here is that once param2 is not present (such as in path 1 with just yourdomainxyz.com/produkt/123) an error arises.

So I’m seeking a way where the same page can both handle
[yourdomainxyz.com/produkt/123]
and
[yourdomainxyz.com/produkt/123/subpage]

@Broberto can’t for so many reasons chief of which is that it looks ugly :rofl:

I think this has been said to not work

1 Like

Not with the same page, but you can create an empty page to handle yourdomainxyz.com/produkt/123.

In the empty page you create a on page load workflow where you send the user to http://yourdomainxyz.com/produkt/123/default for example.

This will then just redirect the user to the default page

Maybe not what you are looking for but I think that’s the only solution I can think of unless weweb adds a possibility for having an empty url variable.

1 Like