I created a nav bar which is linked in all pages, so that any modification done will be applied to all pages.
However, I want to make 2 versions of it (or maybe more later), depending on the login status.
Basically, it’s a nav bar showing the logo on the left, some menu items on the middle and a login / account / sign up button on the right. So, if the user is not logged in, it should not show the menu items on the middle and should show Sign up / Login buttons on the right. However, if the user is logged in, it should show the menu items in the middle and show an account button on the right.
Any ideas how to do it? I’ve thought about creating 2 menus which are linked in all pages and show / hide one depending on the page. Any better ideas?
You can indeed have 2 versions of the navbar and hide/show one of them depending on the context.
But you can also easily do the same with certain sections or elements in a single navbar.
You can link the conditional visibility of the item to a specific variable, in this case to the variable if the person is authenticated or not you can decide to show or hide something (in this case, only show button if person is logged in):
And here you can make the text dynamic, where you create an “if formula” that will return some different text depending if the person is logged in or not.