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

XF 1.2 move tab before forums

Discussion in 'Troubleshooting and Problems' started by Adam Howard, Sep 23, 2013.

  1. Adam Howard

    Adam Howard Well-Known Member

    www.sociallyuncensored.eu 2013-9-23 6 58 53.png

    So I learned that if I go in debug mode, I can change the order of my tabs by changing the process order for the navigation.

    What I can't seem to figure out is how to put something before the "forums" tab.

    Home | Blogs | Forums | Media | Members

    Is how I would prefer it to be.
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    In the Listener for the add-on, there will be a function that creates the navigation tab. You should be able to ascertain which PHP file handles that by looking at the callback of the aforementioned code event listener, where you changed the process order.

    Quite simply there will be a PHP array that defines the tab, title, link etc. also its position. Its position is currently "middle". Change it to "home". That should sit between Home and Forums.

    FWIW another valid position is "end" which would sit it after the Members tab.
     
  3. Adam Howard

    Adam Howard Well-Known Member

    I do not think I can change it to "home" as the portal I am using is already home.

    Or am I wrong?
     
  4. Chris D

    Chris D XenForo Developer Staff Member

    You are wrong.

    "home" is just a position. It doesn't mean to refer to any specific tab of the same name. Think of it more as "Start" in the context of the positions below.

    There are three positions.

    Home: Between Home and Forums.
    Middle: Between Forums and Members.
    End: After Members.

    You can have as many navigation tabs as you like at each position (you can then fine tune the order of those tabs at each position with the execution order of the listener).
     
    Jeremy, Adam Howard and Dan like this.
  5. Dan

    Dan Well-Known Member

    It should work.

    The position in the listener won't replace the home tab:)
     
    Adam Howard and Chris D like this.
  6. Adam Howard

    Adam Howard Well-Known Member

    (y)

    It did end up above home, which I didn't want it to do.... But then I just changed the process order in debug mode and that solved it.

    Thank you @Chris Deeming

    Solution:

    For those who may want to do the same

    library/XfAddOns/Blogs/Template/Navigation.php

    look for
    PHP:
          self::addLinkToBlogsHomePage($extraTabs$selectedTabId'middle');
    change to
    PHP:
          self::addLinkToBlogsHomePage($extraTabs$selectedTabId'home');
    Don't thank me... Thank Chris :barefoot:
     
    Chris D likes this.
  7. Adam Howard

    Adam Howard Well-Known Member

    Want to correct myself....

    Look for
    PHP:
        {
           
    self::addLinkToBlogsHomePage($extraTabs$selectedTabId'middle');
         }
         else
         {
           
    self::addLinkToMyBlog($extraTabs$selectedTabId'middle');
         }
    And replace "middle" (which is there 2x) with "home" so when done it will look like this
    PHP:
        {
           
    self::addLinkToBlogsHomePage($extraTabs$selectedTabId'home');
         }
         else
         {
           
    self::addLinkToMyBlog($extraTabs$selectedTabId'home');
         }
     

Share This Page