Skip Navigation

[Resolved] Show username or Login base on login status

This support ticket is created 4 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 11 replies, has 3 voices.

Last updated by WeiS2074 4 years, 7 months ago.

Assisted by: Jamal.

Author
Posts
#1657065

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?

#1657135

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. **

#1658349

please share the private link, as I don't see any protection form the reply like other supporter sent me.

#1658421

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

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.

#1660055

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.

#1660057

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.

#1660167

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.

There is also the Nav Menus Roles that can display the current user username. Check it here https://wordpress.org/plugins/nav-menu-roles/

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.

#1660221

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.

#1660373

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.

#1661241

To go back to my question. CanToolset implement this approach? If yes please guide me.

#1661359

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.

#1661713

My issue is resolved now. Thank you!