I have a bit improved way of doing this, hope it helps.
Create a datatype called navigation.
You need values of:
- Name (type text)
- Parent Menu (type navigation) (only if using sub menus)
- order (type number)
- Icon (image) (only if your UI requires it)
- hover icon (only if UI requires it)
Here’s an example
Name : Home page
Parent Menu: blank
Now in your UI on your sidebar you will have a repeating group of navigation → do search for navigations
With constraint of parent menu is empty
Inside of the cell have a text element for current cells name.
If you have sub menus you will then have a repeating group nested inside the first one for do search for navigations
With the constraint of parent menu = current cells navigation.
So a sub menu data point will be like the example above but set the parent menu to the nav item you want it nested in.
For example if I want to have a sub menu inside my home page group the parent menu data point will be home page (since the type is navigation)
Set the data type of the page as “navigation”
We will assume this is a single page app on the index page
Now put a work flow on the cell text as go to page index data to send is current cells navigation.
This allows you to navigate while still utilizing back and forward plus easily adding future menu items while condensing your workflow down to only 2 actions.
Additionally have a conditional action for “if index navigation is empty → go to page index with data as do search for navigation name = Home Page :first item
So you won’t ever have a blank page.
Now on each group (page) inside your single page app have them not show on load with a conditional as “when index navigation is (corresponding page name) this item is visible.
- No need for states.
- Faster to add future menu items
- Condensed work flow
- Easy future UI redesigns
- Quick to add conditional UI rather than having to duplicate 10+ conditionals
- Utilizes forward and back