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

Implemented When will we be able to link direct to a js tab?

Discussion in 'Closed Suggestions' started by ragtek, Jul 12, 2012.

  1. ragtek

    ragtek Guest

    see title:p

    (if somebody doesn't know what i mean:
    http://xenforo.com/community/members/ragtek.82/#info doesn't link to the information tab, the first tab is always active instead of #info in my example...
    which links direct to my releases tab

    it's really anoying, specially if you have addons which have to redirect to the same page after some action... e.g. when i create/delete a usernote, it redirects after the action to the profile posts tab instead of setting the user notes tab active

    It's a bug since the first beta, which is really very annoying...

    The only way i'm aware of, is this:
    <script type="text/javascript">
        $(document).bind('XenForoActivationComplete', function() {
            $test = document.URL.split("#")[1];
            if ($test && $test == 'invitestab') {
                $tabContainer = $('#ragtektabs');
                var $api = $tabContainer.data('tabs');
                $current = $api.click(1);
    $noTab = $("li.noTab");
    $noTab.bind('click', function(){
    window.location = $noTab.data('url');
    but it's working only for own pages where i exactly know how many tabs exist and the possition, so it's not possible to use this "hack" for addons adding own tabs to the profile, because you never know the possition of your tab
  2. Naatan

    Naatan Well-Known Member

    I've noticed this as well, have yet to dig into it (I thought I had missed something myself, apparently not). Will let you know if I find anything, but most likely this just needs to be fixed by the devs. Shouldn't be too hard to create a workaround that works for all tabs though.
    ragtek likes this.
  3. Lost

    Lost Well-Known Member

    I could really use this functionality as well.
  4. Sadik B

    Sadik B Well-Known Member

  5. Floren

    Floren Well-Known Member

  6. DRE

    DRE Well-Known Member

    *scratches head*
  7. Chris D

    Chris D XenForo Developer Staff Member

  8. Dan

    Dan Well-Known Member

    We've created this solution
    <script type="text/javascript">
    $(document).bind('XenForoActivationComplete', function() {
    $tab= document.URL.split("#")[1];
    if ($tab) {
    $tabContainer = $('#tabcontainer');
    var $api = $tabContainer.data('tabs');
    var tabArray = $api.getTabs();
    $.each(tabArray, function (i,val){
    if (tabArray[i]['hash'] == '#'+$tab){
    Which works for all tabs in the tabcontainer:)

    I think if i could find a way to hook into the xenforo_tabs method, it would work for all xenforo tabs.
    The only problem is that it's working only for the tab, we can't jump to hash:/

    e.g. http://xenforo.com/community/members/extralicense.45340/#profile-post works

    http://xenforo.com/community/members/extralicense.45340/#profile-post-13806 works not because the tabname is wrong profile-post != profile-post-13806
    Steve F likes this.
  9. Mike

    Mike XenForo Developer Staff Member

    1.2 supports this out of the box, based on the ID attached to the pane.
    Andrej, sonnb, Dan and 2 others like this.

Share This Page