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

How to register variables to use in template modifications?

Chris D

XenForo developer
Staff member
#2
Either way it will require some element of PHP knowledge.

There's a possibility you could do it using {xen:callback tags (new - I haven't used these myself yet) or you could extend Controllers using an add-on. When you extend a controller you can call the parent and add additional variables to the view.

You can also use template hooks and the template post render event but certainly the former of the two is now deprecated and as such you cannot guarantee they'll be around forever.
 

Lior.

Well-known member
#3
Either way it will require some element of PHP knowledge.

There's a possibility you could do it using {xen:callback tags (new - I haven't used these myself yet) or you could extend Controllers using an add-on. When you extend a controller you can call the parent and add additional variables to the view.

You can also use template hooks and the template post render event but certainly the former of the two is now deprecated and as such you cannot guarantee they'll be around forever.
I don't mind using PHP, it's just that I'm new to XenForo and I'm just starting to learn it, so you'll have to forgive me.

How would I actually go about adding the additional variables to the view?