XF 1.4 set RM to be at the Home-Tab position ?

erich37

Well-known member
I would like to put the RM at the Homepage.

I have changed the "Index Page Route" towards resources/
This is working fine.


Question:
How do I change the position of the Nav-items, so that "Resources"-Tab is at the left position, and the "Forums"-Tab is at the right-hand-side of the "Resources"-Tab ?


change_nav_position.gif




Many thanks!
 
edit the file: /library/XenResource/Listener/Template.php

find this method at the bottom of the file and change the position from middle to home (as shown below)
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' => 'home',
                'linksTemplate' => 'resources_tab_links'
            );
        }
    }

Selection_545.webp

You will likely need to enable debug mode and change the execution order.
normally, but not in this case as the "middle" position is between 'Forums' and "Members"

The order is:
<!-- home -->
<!-- extra tabs: home -->
<!-- forums -->
<!-- extra tabs: middle -->
<!-- members -->
<!-- extra tabs: end -->
 
Last edited:
Many thanks! I will try it.

I actually saw this implemented at www.xenzine.com and thought I could do the same by just putting the "Resource Manager" as the "Home"-Tab with some simple clicks.
I just now realized that tenants has build this feature into his Addon.... and that there is no default option in XF in order to achieve this.
https://xenforo.com/community/threads/route-filters.47946/page-5#post-566680

Several addons are starting to include an option for this. I've added an option to most of mine. I nicked the idea from @Chris D & XFMG :)
Selection_546.webp
 
I see.

If 3rd-party Addons are having this option, then I think there should be also an option build into the RM (Resource Manager) in order to make this easier.

But I guess/hope we will see this with XF 2.0

:)
 
Top Bottom