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

XF 1.2 Sublink for Home

Discussion in 'Styling and Customization Questions' started by Anh3Hung, Aug 28, 2013.

  1. Anh3Hung

    Anh3Hung New Member

    This is a stupid question.....

    How to create or active the tab sub-link for Home in NavigationBar like Forum, Member... on navigation bar?

    Thanks
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Anh3Hung likes this.
  3. Anh3Hung

    Anh3Hung New Member

    how about edit code in the navigation template ?
     
  4. EQnoble

    EQnoble Well-Known Member


    Though I would probably just use Nodes As Tabs, this is an example of how you can do that with template edits or modifications.

    Edit template: navigation

    Find:
    HTML:
            <!-- home -->
            <xen:if is="{$showHomeLink}">
                <li class="navTab home PopupClosed"><a href="{$homeLink}" class="navLink">{xen:phrase home}</a></li>
            </xen:if>
    Replace with:
    Code:
            <!-- home -->
            <xen:if is="{$showHomeLink}">
                <li class="navTab home {xen:if $tabs.home.selected, 'selected', 'Popup PopupControl PopupClosed'}">
                    <a href="{$homeLink}" class="navLink">{xen:phrase home}</a>
                    <a href="{$tabs.home.href}" class="SplitCtrl" rel="Menu"></a>
                    <div class="{xen:if {$tabs.home.selected}, 'tabLinks', 'Menu JsOnly tabMenu'} homeTabLinks">
                        <div class="primaryContent menuHeader">
                            <h3>{xen:phrase home}</h3>
                            <div class="muted">{xen:phrase quick_links}</div>
                        </div>
                        <ul class="secondaryContent blockLinksList">
                        <xen:hook name="navigation_tabs_home">
                            <li><a href="http://EXAMPLE.COM/PAGE1" rel="nofollow">EXAMPLE LINK 1</a></li>
                            <li><a href="http://EXAMPLE.COM/PAGE2" rel="nofollow">EXAMPLE LINK 2</a></li>
                            <li><a href="http://EXAMPLE.COM/PAGE3" rel="nofollow">EXAMPLE LINK 3</a></li>
                            <li><a href="http://EXAMPLE.COM/PAGE4" rel="nofollow">EXAMPLE LINK 4</a></li>
                            <li><a href="http://EXAMPLE.COM/PAGE5" rel="nofollow">EXAMPLE LINK 5</a></li>
                        </xen:hook>
                        </ul>
                    </div>
                </li>
            </xen:if>
     
    Anh3Hung likes this.
  5. Anh3Hung

    Anh3Hung New Member

    yes, it shows the menu in Home tab but it doesn't show the sub menu like this:

    [​IMG]

    how to edit Navigation template to always show the Home' sub menu like Diễn đàn (forum)' sub menu.

    Thanks alot.
     
  6. EQnoble

    EQnoble Well-Known Member

    Since your home tab is not selected it will not display.

    If your tabLinks from your home tab always display there will be problems when you are at a page that corresponds to a different tab.

    I did it this way so the home tab has a drop down menu because by default xenforo doesn't have a home page and therefor the home tab will never be selected by default in any scenario.

    If you have a custom home page you would need to customize whatever you use for a home page for these to display as tabLinks underneath the Home tab when it is selected.
     
  7. Anh3Hung

    Anh3Hung New Member

    when i click on the home it doesn't show the home' sub-menu :(
     
  8. EQnoble

    EQnoble Well-Known Member

    When you click home it goes to a link you set when you installed xenforo

    If you make your home button link to the forums...the forums tab will be selected because that is where you are regardless what you clicked to get there.

    If you want your home tab to display the links below it you need to apply that to whatever custom thing you use for a home page so that when you are actually viewing a 'home page' the home tab will be selected and it's sublinks will show.

    If you just want those links to show when you click home and disappear when you move your mouse away or click something else that can be done but it would require custom javascript.
     
  9. Anh3Hung

    Anh3Hung New Member

    i got it, thanks alot
     
  10. reddy ink

    reddy ink Active Member

    @EQnoble Hello, My home page is linked to a page that doesn't have any sub-links.
    I would like to add sublinks and not a drop down. THis will stay underhome all the time.

    What changes do I need to make to the code below to accomplish that?

    Many thanks!
    upload_2014-11-15_13-32-15.png



     

Share This Page