Lack of interest Allow Variable Override in Templates


Well-known member
I'd like to be able to override variables that already exist in templates.

<xen:set var="{$user.username}">My String</xen:set>
Which will replace all occurrences of {$user.username} with My String.

Why do I want this? It makes things like this easier!

(If this is possible I obviously did it wrong :D)


XenForo developer
Staff member
I'm not sure if we support setting array elements and that's what you're bringing up, or if you're proposing the <xen:set /> tag... but we already have <xen:set var="$name">value</xen:set> :) It's done on a per template level. It doesn't really look like what you want to do is at the template level though. Filtering controller responses seems like the best thing to do.


Well-known member
I know <xen:set /> exists, I was just looking for a simple way to override a pre-set variable in a template.
<xen:set var="{$thread.username}">Some random user</xen:set>

It probably isn't something that should be done at template level, but I suggested it to get an opinion.