Lack of interest Allow Variable Override in Templates

This suggestion has been closed automatically because it did not receive enough votes over an extended period of time. If you wish to see this, please search for an open suggestion and, if you don't find any, post a new one.

James

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

Example:
Code:
<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)
 
Upvote 0
This suggestion has been closed. Votes are no longer accepted.
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.
 
I know <xen:set /> exists, I was just looking for a simple way to override a pre-set variable in a template.
Examples:
<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.
 
Top Bottom