Navigation with path url

On a dashboard, when no segment has been added on the url when the page is loaded, I want to set a segment by default which will be the first item of the menu.

Exemple :
If the root of the url is mydomain.com/dashboard
When the page is loaded for the first time, I would want it to become mydomain.com/dashboard/firstItemOfTheMenu

Then, to be able to change only this last segment of the path to hide and show sections. What would be the best approach to do so?

Thank you all

Hi @fak :wave:

Just to clarify, this means that the /dashboard page wouldn’t exist. Even if people typed in mydomain.com/dashboard, you wouldn’t want them to land on that page, you’d want to redirect them to /dashboard/firstItemOfTheMenu page. Is that right?

Exactly that @Joyce :+1:

@Joyce There is no mean to do that? It seems to be a very small things that I’m used to do with Bubble but I’m trying to test weweb and block on this.

How I can play with this url path?

Thanks

If the first item was always the same, then you could setup a redirection here: App settings | WeWeb documentation

If the first item on the menu is dynamic, then you’d probably need to use an id in the slug.

Could you share a video of what you’re trying to achieve, what you’ve tried so far and where you’re stuck?

Or join us during one of our Office Hours?

Hi @Joyce , thanks for your reply.

Here is a video : Example portal | Loom

Ah ok, got it!

So for your first question, yes, you can do this. If the items in the navigation menu are always the same, then I would:

  • create one page for each item with the structure you mention
  • setup a redirection so that when someone tries to access the /portal page, they are redirected to /portal/repairs page

For your second question, if you use multi-page sections, the result on the published app will be similar to the one in your video. Inside the editor, we change page completely and reload everything but the published app is a single-page application so will only load new sections.

Does that help?

Yes, thanks for time and the response :pray:

I was subordinating this type of behavior between preview and live, so thanks for confirming it.