XF 1.4 Custom navigation tab based on cookie

KenBrace

Active member
I am using XenForo under a portal site of mine. I want the forum and primary site to be connected with the same navigation bar. One of the tabs will be labeled "My Dashboard". However, I only want this tab to show if the login cookie for my primary site is set. The primary site was custom designed by myself and has nothing to do with XF. The easy solution would be to add the following PHP code in the "navigation" template.

Code:
if(isset($_COOKIE['TFWUsername'])){
[INDENT]echo "<li class="navTab PopupClosed"><a href="/dashboard/" class="navLink">My Dashboard</a></li>";[/INDENT]
}

However PHP cannot be placed directly in a XF template. I've looked at the documentation for the <xen:include> functionality but it seems to only work for CSS as I have been unsuccessful with including a PHP file with the above code.

What should I do?
 
Back
Top Bottom