Guide to creating template helper functions

rys

Member
Hi all,

I want to write a helper function available to my site templates, to help me integrate with a third-party service. I've written the function to work on the data, and I know how to call it from a template.

How do I package that function up into the right files inside my XF install so that the template language can pick it up? Do I have to register the function anywhere so that XF knows its available to my templates?

Just looking to tie it all together now really.

Thanks in advance for any and all help, and sorry for the newbie question!
 
I'd seen that guide previously but didn't think it applied to XF 1.3+. If it still applies to 1.5, I can't see the Development part of the Admin CP that lets you create new add-ons and event listeners. Sorry if I'm just being really blind and it's right in front of me somewhere.
 
Good point on the version compatibility. The author of that guide isn't around as much any more but I have just edited it to reflect it is still valid for newer XF versions.

To enable debug mode, you need to add the following to your XF config.php file:
PHP:
$config['debug'] = true;
 
  • Like
Reactions: rys
Excellent, that's worked great. Thanks a lot, and sorry for not realising how to enable debug mode.
 
Top Bottom