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

How to Set the Selected NAV Button?

Discussion in 'XenForo Development Discussions' started by robdog, Mar 24, 2011.

  1. robdog

    robdog Well-Known Member

    I have created some external pages which work fine with custom blocks, breadcrumb, nav buttons. But when I go to a page that is routed to a nav button, it is not being styles as selected.

    Here is the button setup:
    $extraTabs['schedule'] = array(
    'title' => new XenForo_Phrase('Schedule'),
    'href' => XenForo_Link::buildPublicLink('full:en/schedule/'),
    'selected' => ($selectedTabId == 'schedule'),
    'position' => 'middle',
    );

    When extending the controllerPublic, do I set the selectedTabId there? Or should XenForo do this automatically?

    Thanks.
     
  2. Arik

    Arik Well-Known Member

    It's actually assigned within the route prefix class, in your match function. It's the third parameter passed to $router->getRouteMatch.
     
    robdog likes this.
  3. robdog

    robdog Well-Known Member

    SWEET this worked. And once I fixed this my breadcrumbs were created properly as well.

    I am just checking things off the list today, GOOD TIMES!
     

Share This Page