Change button/text display based on condition
Hello,
We'd like the ability to display a specific button, or display another in its place based upon the condition of if the user is logged-in or not.
How can we do this within the Brizy Builder (when editing a page/template)?
(Note: the native "Login Button" uses this condition, but it also displays the fields by default. And we can't use this unless we can remove the fields displaying, and instead just a button with custom text).
-
Hi,
You can do this with the Membership functionality. Therefore, you can create 2 blocks. In the first block add the first button and in the second block - the second button. For both blocks activate the Membership function and set-up which members do you want to see the first block and which one the second one. For more details about the Membership function, you can check this article and these YouTube tutorials.
https://www.brizy.io/membership-in-brizy-wordpress/
https://www.youtube.com/watch?v=Zp1DMIFUubg
https://www.youtube.com/watch?v=ig5VvyRv34Q
Best regards,
Sandra0 -
Thanks for the reply.
- I notice the ability to do this with blocks, though what about buttons within a block?
- I also recognize that not all of my user roles are displayed as an option. Note: I'm trying to simply change a button from "Log In" to "Log Out". See here: https://www.evernote.com/l/AHXeuG818-9KX4oqnD6ZnxVmu3GAz3dtVZM
Can you please help provide a solution?
Cheers!
0 - I notice the ability to do this with blocks, though what about buttons within a block?
-
Hi,
1 - Unfortunately, at the moment, the membership functionality can be added only to the blocks. Now, it isn't possible to add it to the element, columns or rows.
2 - Did you try to scroll inside the Select element? See here.
Thanks!
Best regards,
Sandra0 -
- So how do you suggest having a button that changes based on logged-in and logged-out?
- Since the membership functionality only exists in relationship to "blocks", how would you go about solving this issue? (Note: we cannot use the default login/logout button because it adds the input fields automatically. Is there a way to change this so that it just contains the button with the text "Log In" when the user is logged out, and "Log Out" when the user is logged in?)
Please help provide some kind of solution, since the functionality we need doesn't seem possible even though it seems this should be an important "feature" that is included by default).
Thanks!
0 -
Hi,
I can suggest watching this tutorial. It is a general presentation about the Membership functionality and here from minute 17:25, you can find exactly how you can create the log-in and log-out functionality.
Let us know if we can help you with something else.
Best regards,
Sandra0
Please sign in to leave a comment.
Comments
5 comments