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

XF 1.4 Custom navigation tab based on cookie

Discussion in 'Styling and Customization Questions' started by KenBrace, May 14, 2015.

  1. KenBrace

    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?
     
  2. KenBrace

    KenBrace Active Member

    Does anyone have an idea as to how I can accomplish this?
     

Share This Page