Cant get sidebar block to view

Matthew Hawley

Well-known member
Okay so This is the code event listener:

g93e.png


TFuKTN3.png


This is the Listener.php template:

Code:
<?php

class VentrilloViewer_Listener
{
    public static function templateHook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
    {
        if ($hookName == 'ad_sidebar_bottom')
        {
            $contents .= $template->create('ventrillo_viewer_sidebar', $template->getParams());
        }
    }
}
 
Yes, your code looks perfect! If you have once more template you want to add, you can also use switch:
PHP:
    switch ($hookName)
     {
       case 'forum_list_nodes':
         $contents =  $template->create('forum_template_1', $template->getParams()) . $contents;
         break;
       case 'another_hook':
         $contents =  $template->create('another_emplate', $template->getParams()) . $contents;
         break;
     }
 
Top Bottom