Teapot
Well-known member
Okay, so, I'm trying to add a "your trophies" button to the account menu that links to members/<visitor's username>/trophies. I've got all the code needed to make the button appear, but I'm having trouble figuring out the syntax for {xen:link}.
 
What I have at the moment is this:
teapot_navigation_mytrophies
	
	
	
		
 
library/Teapot/MiscTrophies/UserMenuTrophies.php
	
	
	
		
 
 
If I click the link currently, it tries to direct me to members/trophies - which of course leads to an error. I've pretty much copied the link code verbatim from here. As an aside, the {xen:number} doesn't work either, probably for the same reason.
 
Thanks for your time
				
			What I have at the moment is this:
teapot_navigation_mytrophies
		HTML:
	
	<li>
    <a href="{xen:link 'members/trophies', $visitor}">
        {xen:phrase your_trophies} ({xen:number $visitor.trophy_points})
    </a>
</li>
	library/Teapot/MiscTrophies/UserMenuTrophies.php
		PHP:
	
	class Teapot_MiscTrophies_UserMenuTrophies
{
    public static function templateHook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
    {
        if ($hookName == 'navigation_visitor_tab_links2')
        {
            $contents .= $template->create('teapot_navigation_mytrophies');
        }
    }
}
	If I click the link currently, it tries to direct me to members/trophies - which of course leads to an error. I've pretty much copied the link code verbatim from here. As an aside, the {xen:number} doesn't work either, probably for the same reason.
Thanks for your time