Quite a few good ideas in this thread. Personally i like the navigation of multi page apps but speed of single page.
To get the best of both worlds create a data type called navigation with a name & slug field and set your page type to “navigation”.
For this example I’m going to assume it’s built on the index page and you have the following “pages” in your SPA - dashboard, analytics, profile, create post. I’ll also assume dashboard is your “home page” in your SPA.
Each “page” in your SPA will have a record in the navigation data as well as a slug.
Have a do only when true flow that says when current page navigation is empty - go to page index - data to send = do search for navigation where slug = dashboard. :first item
(This ensures that you never have an empty value)
On your menu you can have an RG of Navigation data items or static but when it’s clicked and time to change “pages” in your SPA you’ll use the same logic as above.
Analytics is clicked you’ll navigate with
go to page index - data to send = do search for navigation where slug = analytics. :first item
For showing and hiding “pages” (groups) in the SPA your conditional will look like
if current page navigation slug is analytics - this group is visible (for analytics page)
To pass data for data required “pages” such as viewing a post on the post page you’ll use additional /paths as @S2294 suggested above OR ?params as @lindsay_knowcode suggested.
Personally I prefer params as it’s cleaner to setup in my opinion.
This setup does a few things.
- Allows for forward and back arrow navigation of your SPA
- Allows you to send direct deep links of your app in a similar fashion of a multi page app.
- Allows your site to still be indexed by google correctly.
- Maintain URLS like website.com/path/path
Also bonus note here: each one of my “pages” in a SPA are reuseable elements. This allows for cleaner dev process, reduced workflow clutter, and keeps bubble editor running fast on very large SPA builds.
I can drop a demo link of this if you need.