1. REGISTRATION REQUIREMENTS:

    Register with your xenforo.com Username then start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Resolved Get rid of search menu

Discussion in 'AMS Support' started by Robert9, Jan 11, 2020.

  1. Robert9

    Robert9 Member AMS Showcase Sportsbook

    You may have a hint how i can get rid of some of the tabs at the search page, please?
     
    Last edited by a moderator: Jan 11, 2020
  2. Bob

    Bob Developer Staff Member

    Yes, 'getSearchFormTab()' is a core function in the src/XF/Search/Data/AbstractData.php that when implementing a search handler in an addon, its used to add a TAB to the search. If an addon does not implement a 'getSearchFormTab()' function in the handler, then the abstract returns false.

    PHP:
        public function getSearchFormTab()
        {
            return 
    null;
        }

    AMS implements a search handler and adds a tab (just like XFRM and XFMG do).

    src/Addons/XenAddons/AMS/Search/Data/ArticleItem.php 'getSearchFormTab()' (line

    PHP:
        public function getSearchFormTab()
        {
            
    /** @var \XenAddons\AMS\XF\Entity\User $visitor */
            
    $visitor = \XF::visitor();
            if (!
    method_exists($visitor'canViewAmsArticles') || !$visitor->canViewAmsArticles())
            {
                return 
    null;
            }

            return [
                
    'title' => \XF::phrase('xa_ams_search_articles'),
                
    'order' => 131 
            
    ];
        }
    You'd have to modify the file by either removing the method or just returning false. You'd need to do this for ANY addon (to include XFRM and XFMG) to remove tabs from search.
     
  3. Robert9

    Robert9 Member AMS Showcase Sportsbook

    I can return null in getSearchFormTab;
    means i should add an addon with all classes to extend what i dont like, ok.

    So we both found it. :)
    Thank you.
     
    Last edited by a moderator: Jan 11, 2020
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.