XF 1.2 move tab before forums

Adam Howard

Well-known member
www.sociallyuncensored.eu 2013-9-23 6 58 53.webp

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.
 
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.
 
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.
I do not think I can change it to "home" as the portal I am using is already home.

Or am I wrong?
 
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).
 
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).
(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:
 
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');
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');
     }
 
Back
Top Bottom