BuddyDev

Search

[Resolved] Setting target window for subnav link in BP Customer Group Tabs

  • Participant
    Level: Initiated
    Posts: 6
    Michael Bronder on #49651

    Hi- There was a similar question about opening a link from Custom Group Tabs in a new browser tab in 2019. See here(https://buddydev.com/support/forums/topic/open-a-link-in-a-new-window-or-tab-with-bp-custom-group-tabs-plugin/).

    But in our case we’d be very happy to open the sub-nav links in a new window/browsertab/popup…

    Reading that earlier thread, it sounds like that’s fairly straight forward? Thanks for any help!

  • Keymaster
    (BuddyDev Team)
    Posts: 24149
    Brajesh Singh on #49653

    Hi Michael,
    Thank you for the question.

    You will need the javascript code specified in the last post. Please use that and customize the ids to your liking.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 6
    Michael Bronder on #49662

    Thank you- this works great for the Parent “Custom Group Tab” (resources-groups-li) but what I’m trying to do is launch “subnav 1” (gstab-647a57cbeca26-li) which in this case is Google.com in a new window… It might be relevant, too, that there is a “subnav 2” which should <not> launch in a new window.

    Maybe I’m not understanding the “var tabSelectors = [‘#activity-groups-li’, ‘#home-groups-li’ ];” and what shoudl go where…

    Many thanks for your help!

    …..
    <li id=”resources-groups-li” class=”bp-groups-tab current selected”>

    <div class=”bb-single-nav-item-point”>Resources</div>

    </nav>

    <div class=”bb-profile-grid bb-grid”>
    <div id=”item-body” class=”item-body”>
    <nav class=”bp-navs bp-subnavs no-ajax group-subnav” id=”subnav” role=”navigation”><ul class=”subnav”><li class=”current selected” id=”gstab-647a57cbeca26-li”>Information and Logistics<li class=”” id=”gstab-647a57cbeca28-li”>Information and Logistics</nav><div class=”bpgtc-tab-content bpgtc-tab-erdi-resources-content bpgtc-tab-erdi-resources-erdi-info-logistics-content “></div> </div>

    </div>

  • Keymaster
    (BuddyDev Team)
    Posts: 24149
    Brajesh Singh on #49665

    Hi Michael,
    Thank you for the reply.
    I am sorry, there is a problem with using the code with sub tab.

    The id for sub tab is dynamic. The second part in gstab-647a57cbeca28 is being generated dynamically and will change on page loads.

    We need to find a way to target these sub tabs by using class or IDE. Please allow me to think about it and get back to you on Monday(This is not standard part of BuddyPress nav).

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 6
    Michael Bronder on #49700

    Hi there- Any update on this please?

    If it’s not possible at all, I understand… but I do have a customer requesting this for a specific project.

    Thanks!

  • Keymaster
    (BuddyDev Team)
    Posts: 24149
    Brajesh Singh on #49702

    Hi Michael,
    I am sorry, I am having issues adding it to the core as it could break for existing user. Will it work if I add a filter and provide you couple of lines of code to make the ids stable/predictable.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 6
    Michael Bronder on #49712

    I’m happy to try that, sure! TY!

  • Keymaster
    (BuddyDev Team)
    Posts: 24149
    Brajesh Singh on #49727

    Thank you.
    I will have an update in next 24 hours.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 24149
    Brajesh Singh on #49730

    Hi Michael,
    Thank you for the patience.
    I realized that we already have the ability to have ids in sub tabs. Please look for CSS id option in sub tab and put the ids there.

    Then those ids can be used in javaScript for opening tabs.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 6
    Michael Bronder on #49753

    Yep! Awesome. TY!

The topic ‘ [Resolved] Setting target window for subnav link in BP Customer Group Tabs’ is closed to new replies.

This topic is: resolved