• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.5 How to store xen:helper dump in HTML tags?

#1
I would like to store the username like this:
<span id='usernameFromXenForo' style='display:none'>{xen:helper dump, $visitor.username}</span>
However, this is undefined.
If I don't put it between HTML tags, it IS defined.

How do I achieve this? Or how else may I keep a reference to visitor.username?
 

DragonByte Tech

Well-known member
#4
If you want the logged in user's name, just use {$visitor.username} :)

There's no need to dump it. If you want, you can also store it in JS, although be careful about usernames with ' or " in them, you may need to look into JS escaping.


Fillip