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

Lack of Interest Set route sections for Search tabs

Discussion in 'Closed Suggestions' started by Chris D, Jun 24, 2013.

  1. Chris D

    Chris D XenForo Developer Staff Member

    It's always bugged me somewhat that there's no navigational context to the search page/tab you're currently viewing.

    I've always felt it would be appropriate for a relevant nav tab to be highlighted depending on the selected search tab.

    I've just discovered this is quite easily possible:

    http://xenmediagallery.com/search/?type=xengallery_media

    As the controller object is available in XenForo_Search_DataHandler_Abstract::getSearchFormControllerResponse() You can very easily set the major/minor route sections:

    PHP:
    $controller->getRouteMatch()->setSections('xengallery');
    So this suggestion is to a) make people more aware of this possibility and b) suggest that (as it's such a small change) this is done for the default search tabs for XenForo 1.2 and the search tabs for the next Resource Manager release.

    The Search Everything tab should remain as it is.

    Search Threads and Posts:
    PHP:
    $controller->getRouteMatch()->setSections('forums');
    Search Profile Posts:
    PHP:
    $controller->getRouteMatch()->setSections('members');
    Search Resources:
    PHP:
    $controller->getRouteMatch()->setSections('resources');
     
    Last edited: Jun 24, 2013
    Walter, xf_phantom and RobParker like this.

Share This Page