XF 2.0 Request for equivalent method call php code etc for xF1 Method

Dnyan

Well-known member
Hello All,

I want equivalent way to do this function in xF2 script. can anyone help me out for this.

Code:
public static function templateHook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
    {
    
            if($hookName === "page_container_head")
            {
                $options = XenForo_Application::get('options');
                $os_user = $template->getParam('visitor');
                
                $params = $template->getParams();
                
                $hash = hash('sha512', $options->os_hash . $os_user['user_id']);
                $params['os_hash'] = $hash;
                $params += $hookParams;
                
                $contents .= $template->create('onesignal_js', $params);
            }
            
            if($hookName === "page_container_head")
            
            {
                $contents .= "<link rel=\"manifest\" href=\"os_manifest\">";
            }
        
    }


Thank You
 
You have to use Template Modifications. Technically you should have been doing the same in XF1.
 
Actually, i dont understand coding.

if you provide one example for one of the attribute, it would be great help for me. I am trying to make my first addon:p
 
It's not coding, it's a find and replace system.

Admin CP > Appearance > Template modifications
 
Top Bottom