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

Template Edits with Add-On

#3
I doubt a template hook is available for Alerts. There wasn't in vbulletin either. I am trying to figure out how to get the template edits to be done by the add-on itself. With vbulletin it was quite simple, but not with XF. Any ideas on how to do a search for specific code and add code after it?

Id like to be able to not have everyone do template edits.
http://xenforo.com/community/threads/sound-notification-free.25605/#post-312688
 

Robbo

Well-known member
#4
The only real way to do it at the moment is a post template listener that manipulates the DOM. You can see this in my add-ons. XenTrader should show it. Annoying and has a performance hit in theory (could add some form of caching I guess) but the only way I have found to do it. In the future I am going to have documents so people can disable the listener doing it and explain to do the edits themselves if they see any performance drops.
 
#5
The only real way to do it at the moment is a post template listener that manipulates the DOM. You can see this in my add-ons. XenTrader should show it. Annoying and has a performance hit in theory (could add some form of caching I guess) but the only way I have found to do it. In the future I am going to have documents so people can disable the listener doing it and explain to do the edits themselves if they see any performance drops.
I don't understand why XF coders made it so complicated that it has to put a load on the servers. I mean do they expect everyone to use template edits? Because not all mods can make use of those.

Is there maybe a way where I can have my template code be within a variable?

Like $soundcode

and have php code locking it into the variable:
$soundcode = 'embed';