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


Active member
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?


XenForo moderator
Staff member
What are you trying to do?

The dump command is typically used for debugging/developing.

DragonByte Tech

Well-known member
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.