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

Adding A Login Link To The Nav Menu

Discussion in 'XenForo Questions and Support' started by System0, Nov 3, 2011.

  1. System0

    System0 Active Member

    Someone pointed out to me that the main login link says 'Sign Up Now' when not logged in. This obviously opens up the login menu at the top of the page too - but I don't think 'Login / Sign Up Now' would look good on the button.

    When you are logged in there is a log out link at the top right hand side of the navigation menu. What template do I need to edit to add a 'Log In' link here when someone hasn't logged in. I know the sign up now button links already does this job but I think it would be useful just in case a member who isn't logged in gets confused (plus that area of the nav isn't being used anyways).

    Kevin
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Admin CP -> Appearance -> Templates -> navigation

    Add the red code at the bottom:

    Code:
    		<!-- no selection -->
    		<xen:if is="!{$selectedTab}">
    			<li class="navTab selected"><div class="tabLinks"></div></li>
    		</xen:if>
    		
    	</ul>
    	
    	<xen:if is="{$visitor.user_id}"><xen:include template="navigation_visitor_tab" /></xen:if>
    	<xen:if is="!{$visitor.user_id}">
    		<ul class="visitorTabs">
    			<li class="navTab PopupClosed"><a href="{xen:link login}" class="navLink visitorTabItem">{xen:phrase log_in}</a></li>
    		</ul>
    	</xen:if>
    </div>
    
    <span class="helper"></span>
    			
    		</nav>	
    	</div>
    </div>
    
     
    System0 likes this.
  3. System0

    System0 Active Member

    Thanks Jake. Works like a charm :)
     
  4. Is there anyway to change the font size or wording for the Log In link that this generates in the nav bar? It's quite small so would like to increase the font size and maybe change wording slightly.
     
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You can use inline styling and replace the phrase with your own text, like this:

    Code:
    	<xen:if is="!{$visitor.user_id}">
    		<ul class="visitorTabs">
    			<li class="navTab PopupClosed"><a href="{xen:link login}" class="navLink visitorTabItem" style="font-size: 12pt;">Your Text</a></li>
    		</ul>
    	</xen:if>
    
     
  6. Perfect! Thank you :)
     

Share This Page