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

Home instead of Resources

Discussion in 'XenForo Development Discussions' started by Floren, Feb 1, 2014.

  1. Floren

    Floren Well-Known Member

    Hi all,

    I was wondering what I need to do in order to use the actual Home link, instead of Resources. My goal is to have the resources/ route point to the Home location, without showing the additional breadcrumb Home > Resources.

    Thank you for your guidelines.
     
    Last edited: Feb 1, 2014
  2. Chris D

    Chris D XenForo Developer Staff Member

    The only way really is to disable the home tab, and rename the Resources one to home.

    That will most likely require a code edit though unless the phrase used on the Resources tab is separate to other usages of the phrase Resources.
     
  3. Floren

    Floren Well-Known Member

    Thanks Chris. I think there is a hook to control where the Resources tab shows (first, middle, last), will this allow me to force the Resources tab display before Forums? I'm going to replace the Resources tab title with already existing phrase Home, so that should fix the issue. I just need to know if there is a way to display the new Home tab before Forums.
     
  4. Chris D

    Chris D XenForo Developer Staff Member

    Yeah the file to edit it:

    library/XenResource/Listener/Template.php

    Head to Line 102 which from there is:

    PHP:
        public static function navigationTabs(&$extraTabs$selectedTabId)
        {
            if (
    XenForo_Visitor::getInstance()->hasPermission('resource''view'))
            {
                
    $extraTabs['resources'] = array(
                    
    'title' => new XenForo_Phrase('resources'),
                    
    'href' => XenForo_Link::buildPublicLink('full:resources'),
                    
    'position' => 'middle',
                    
    'linksTemplate' => 'resources_tab_links'
                
    );
            }
        }
    As you need to edit the file anyway, first, you might want to just change the used phrase so change:
    PHP:
                    'title' => new XenForo_Phrase('resources'),
    to:
    PHP:
                    'title' => new XenForo_Phrase('home'),
    Then change:
    PHP:
                    'position' => 'middle',
    to:
    PHP:
                    'position' => 'home',
    End result:

    upload_2014-2-1_20-40-27.png
     
  5. Floren

    Floren Well-Known Member

    Thanks Chris. :)
     

Share This Page