Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2020-09-25 21:20:53

giz
Member
From: New Zealand
Registered: 2004-07-26
Posts: 190
Website

How do you display the logged-in username?

I’ve been cleaning up all my myriad instances of the rvm_if_privileged plugin, swapping them out for if_logged_in.

All good, bar this one: <txp:rvm_privileged_user type="name" />.

Anyone know how to grab the logged-in username using native tags?

Offline

#2 2020-09-25 22:21:24

etc
Developer
Registered: 2010-11-11
Posts: 3,940
Website

Re: How do you display the logged-in username?

Your only core option is, I’m afraid,

<txp:php>
    global $userInfo;
    echo $userInfo['name'];
</txp:php>

Replace echo $userInfo['name']; with dmp($userInfo); to see all available fields.

Offline

#3 2020-09-26 01:20:34

giz
Member
From: New Zealand
Registered: 2004-07-26
Posts: 190
Website

Re: How do you display the logged-in username?

Thanks, Oleg. Simple!

Offline

Board footer

Powered by FluxBB