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

Add-on Easy header/footer includer

Mike Creuzer

Well-known member
Hey all devs!

Looking for a plugin that will allow me to include a file from on the server (or anywhere) and include it in the page with options for a file_get_contents() and include(). I find this to be a very common thing people need to do and it'd be nice if it was in an easy to install plugin form. Not sure if this exists either I havent come across anything in the search at least.

PM me with pricing!

@Chris D @shadrxninga @Waindigo


Chris D

XenForo developer
Staff member
It's more than likely possible with a callback template tag.

This allows you to call a PHP script from a template.

This is the basic usage. Add this to your footer template (or wherever):
<xen:callback class="YourAddOn_Callback" method="renderFooter" />
The class name is derived from the file path and file name, so the above would point to a file: library/YourAddOn/Callback.php.

So create that file, with these contents:


class YourAddOn_Callback
    public static function renderFooter($content, $params, XenForo_Template_Abstract $template)
        return '<b>Hello Audentio!</b>';
End result:


Of course there's a lot you could do aside from that...