Hi buddy,
So the question was, and hopefully its not too much of a bother. How would we assign one of our repeating group values a logout function. Then after we log out, is it possible to be re directed to a certain key value?
So after logout, user would be redirected to home group?
If we were using multiple pages I guess the steps would be much easier, but seeing as we are using a single page this is where it got tricky for me.
Look forward to any insight you may provide on this
In that example I’m triggering one set of actions if the button’s type is Logout, and one set of actions if the button’s type is empty. The button is the same, so you can use it for buttons or groups within a repeating group. You would do the same based on your dataset with one more level of depth, something like - if this button’s menu_item’s tag is: logout.
For this piece, in a Single Page App structure, you can just add a group that shows to all logged out users using a conditional
Which you would probably do anyways.
Then you wrap the elements that you show to logged in users using the opposite conditional: when current user is logged in. Note that you’d want these “master groups” to start off as invisible.
If I could bother you with something else?
Seeing as its a single page app, how do we differentiate between user types? Bussiness/customers etc, where on sign up/ login as customer shows different groups to businesses.
I made a drop down with the user types in sign up, and created a state (possibly incorrectly) but regardless of which one I choose to sign up as it shows customers views…
I created 2 data types (business/customer) with relevant fields, and im referencing those on sign up and they’re populating in the db correctly. The only thing that’s wrong is the signing in where it defaults to a customer view…
Sorry that was a bit long haha, but if you can help with this I would much appreciate it if not I completely understand too
Cheers buddy
Yes well, this would be either in your “master” group conditionals, you could have something like
In your example you’d have three “master” groups:
when > this user is logged out > this group is visible
when > this user is logged in AND this user’s tag is “business” > this group is visible
when > this user is logged in AND this user’s tag is “customer” > this group is visible
etc. This is the point you want to plan all user types and make sure they all work. Maybe you’ll have business > big and business > small and customer > north america and customer > east asia, I don’t know. But if you start having big conditionals, or conflicting conditionals, you’ll slow your app down. Plan plan plan You can bring in multiple variables through your url: