I want to add a tab in my menu bar which shows current user username if login, otherwise shows label "Login"
After a search on a similar topic, I found https://toolset.com/forums/topic/display-current-users-name-in-a-menu/ The solution comes with Views which it not for "blocks" design. How do I approach this?
Hello and thank you for contacting the Toolset support.
There is a conditional block that you can use to show the name of the user or the link. Actually, you will need to use two conditional blocks with the same condition, but one of them will be configured to evaluate falsely. In the first, you will display the user name, on the second, a link to the login page.
If you encounter troubles implementing it, please allow me temporary access to your website and let me check it closely. Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **
Jamal is on holiday today. He will get in touch with you as soon as he back to work.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
Hello, I am back again and thank you for the credentials.
I can see that you are using the plugin "User Menus" to customize the menu, please check this screenshot hidden link
it explains a bit about what to choose.
If you are trying to implement this for a content template or a view, please let me know which one and I'll give it a try.
Thanks for the reply. "user menus" has a limitation. I want to create a tab when user login it will show its user name. With "user menus" solution, I need to create an empty page which its title needs to be {nickname}. Yes, it works. but the problem is that this menu is clickable. After a user clicks into that page, which is an empty page with {nickname} as a title. It is a bad user experience and confuses them.
That's why I am looking for a toolset solution. Or if there is another good solution please let me know.
I do not think you will need to create an empty page and call it {nickname}, you can use any page, my account page for example, and enter the title that you would like to have on the menu( "Hello, {nickname}" ). When the logged-in user clicks on it, it will go to "My Account" page.
Anyway, Toolset plugins do not act or affect the WordPress menus at all. I am sure you will understand that your question about the WordPress menus is out of the scope of this support forum.
I understand other plug-in is out of your support scope. That's why I ask how does Toolset implement this approach? As you mentioned in your first reply. I am not quite clear about the instruction. can you explain to me more details.
Actually my first reply was not around WordPress menus, I thought you were talking about Toolset content templates and views built with Blocks or the legacy editor. I was biased by the word tab and I thought you are probably using a plugin that provides tab blocks or you were implementing Bootstrap tabs.
Toolset plugins have no effect on WordPress menus(Appearance->Menus). And it is out of the scope of all Toolset plugins.
There is no way to customize WordPress menus with Toolset plugins, even though you can insert a menu inside a Toolset Layout, Toolset Layouts does not have any way to customize it and change the values of the menu items depending on a certain logic(logged-in/out).
On the other hand, you can build menus with views, and insert them inside other views or content templates. The menus that you can create with Toolset are not WordPress menus and cannot be displayed inside of WordPress menus locations.