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

Cant get sidebar block to view

Matthew Hawley

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





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());
        }
    }
}
 

Marcus

Well-known member
#3
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;
     }