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

Template hook doesn't work

Discussion in 'XenForo Development Discussions' started by Arty, Feb 5, 2012.

  1. Arty

    Arty Well-Known Member

    I'm trying to append css at the end of xenforo.css template. I've created event listener for it and put this simple code for test:
        public static function templateHook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
                case 'xenforo_css_extra':
                    $contents .= 'test { whatever } ';
                case 'body':
                    $contents .= 'This is a test!';
    For some reason hook for "xenforo_css_extra" never gets called.

    Hook for "body" does work correctly, so event listener is working. I'm testing it with default style that has <xen:hook name="xenforo_css_extra" /> at last line of xenforo.css
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Arty likes this.
  3. Arty

    Arty Well-Known Member

    Thanks. I guess it is caused by that bug.
  4. xfrocks

    xfrocks Well-Known Member

    This is not the same problem. CSS script (css.php) doesn't call dependencies class so plugins simply don't work when CSS is generated.

Share This Page