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

XF 2.0 Looking for Hook Alternative

[xFv]

Previously Cylent1
#1
Hello!
In XF1 we used to be able to use a listener to hook into the forum like example below.

Code:
<?php
class some_class
{
    public static function templateHook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
    {
        switch ($hookName) {
            case 'Some_hook':
               $get_template = $template->create('Some_template', $template->getParams());
                   $contents = $get_template . $contents;
                   break;
        }
    }
}
Since hooks are gone in XF2, what would I use exactly or what would be the XF2 equivalent to this?
 

Chris D

XenForo developer
Staff member
#2
They haven't been recommended to use for about 5 years. They were deprecated and have been removed in XF2.

You should be using "Template modifications". See the "Appearance" section in the Admin CP.