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

Is it possible to open profile with other tab open?

Discussion in 'XenForo Development Discussions' started by Luciano, Aug 20, 2011.

  1. Luciano

    Luciano Member

    I would have thought it could be possible to open the profile with another tab open than the first one.
    Example: If I open my profile here, its:
    http://xenforo.com/community/members/luciano.2473/
    i get the first tab selected by default.

    Now to my understanding, all tabs have urls in them, with a jumpmark.
    the infotab on my profile has:
    http://xenforo.com/community/members/luciano.2473/#info

    So I thought by typing in that url, it would load my profile page with the information tab open.
    (that was a mistake, even with that url, the page loads with the first tab open.)
    so here is my question:
    Is there a way to load the profile page to have another tab open by default than the first one?

    thanx for any reply.

    Luc
     
  2. ragtek

    ragtek Guest

  3. Luciano

    Luciano Member

    YES!!! thank you!
    Actually I wanted to make another tab, that i called "MySpecialTab" default on pageload.
    So what i did, thanks to your js... in the other thread.
    1. I added the tab per template hook. (there i give the <li> an id="MySpecialTab")
    2. I added following javascript
    Code:
    <script type="text/javascript">
    var qgFirstLoad = true;
    $(document).bind('XenForoActivationComplete', function() {
        if(qgFirstLoad)
        {
            $("ul.tabs.mainTabs > li#MySpecialTab > a").click();
            qgFirstLoad = false;
        }
    
    });
    </script>
    Needed the first load variable, because if the content is loaded per ajax, the XenForoActivationComplete is triggered again.
    for me this works like a charm.
    I will later on make a useroption, so the user can choose if he wants first tab to be default or MySpecialTab to be default on his profile.

    Thanks again for pointing me in the right direction.
    Luc
     

Share This Page