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

Account Sidebar Problem

Discussion in 'XenForo Development Discussions' started by ragtek, Feb 3, 2011.

  1. ragtek

    ragtek Guest

    I've created a template for my invite add-on

    <li class="section">
        <h4 class="subHeading">{xen:phrase ragtek_invites}</h4>
                    <a class="{xen:if "{$selectedKey} == 'invites/manage'", 'secondaryContent', 'primaryContent'}"
    						href="{xen:link invites}">Manage invites</a>
    This i want to insert into the account sidebar.

        public static function templateHook($name, &$contents, array $paramsXenForo_Template_Abstract $template){
            if (
    $name == 'account_wrapper_sidebar'){
    $search '<!-- slot: pre_conversations -->';

    $inviteBlock $template->create('ragtek_invite_sidebarblock')->render();

    $contents str_replace($search$search $inviteBlock$contents);
    That's working fine, BUT the $selectedKey variable isn't set, so my elements gets the false css class:(

    BUT it should work, because i'm using the account wrapper
    return parent::_getWrapper('invites''manage'$this->responseView('Ragtek_Invite_View'$template$this->getViewParams($getAllParams)));
    This means, that selectedKey is 'invites/manage', right?
    I've checked it in XenForo_ControllerHelper_Account::getWrapper
    and it it invites/manage, so why it isn't available in my template?
  2. Shadab

    Shadab Well-Known Member

    ragtek likes this.
  3. ragtek

    ragtek Guest

Share This Page