1. 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

Discussion in 'XenForo Development Discussions' started by Matthew Hawley, Jul 30, 2013.

  1. Matthew Hawley

    Matthew Hawley Well-Known Member

    Okay so This is the code event listener:

    [​IMG]

    [​IMG]

    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());
            }
        }
    }
     
  2. Matthew Hawley

    Matthew Hawley Well-Known Member

    Nevermind, it was a permission error.
     
  3. Marcus

    Marcus Well-Known Member

    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;
         }
     
    Pereira likes this.

Share This Page