R
ragtek
Guest
I've created a template for my invite add-on
This i want to insert into the account sidebar.
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
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?
Code:
<li class="section">
<h4 class="subHeading">{xen:phrase ragtek_invites}</h4>
<ul>
<li>
<a class="{xen:if "{$selectedKey} == 'invites/manage'", 'secondaryContent', 'primaryContent'}"
href="{xen:link invites}">Manage invites</a>
</li>
</ul>
</li>
PHP:
public static function templateHook($name, &$contents, array $params, XenForo_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);
}
}

BUT it should work, because i'm using the account wrapper
PHP:
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?