BuddyDev

Search

[Resolved] Which tag should I use?

  • Participant
    Level: Guru
    Posts: 995
    calu on #31129

    Hi there, I have been looking around in the General Template Tags in https://codex.buddypress.org/ for the right tag for edit my profile groups/fields, ul.button-nav li a.

    According to the documentation bp_get_options_nav()should be the one, but it is not.

    “for profile it contains: [Public, Edit Profile, Change Avatar]”

    Which tag should I use to target and reposition this group with a hook?

    Regards
    Carsten

  • Keymaster
    (BuddyDev Team)
    Posts: 21785
    Brajesh Singh on #31137

    Hi Carsten,
    Thank you for the question.

    You can use this inside the profile loop

    
    <?php bp_profile_group_tabs(); ?>
    

    Also, you do not need to add it via any hook. You can use template override.Adding content via hooks are normally preferred when you don’t have much control over the template.

    Regards
    Brajesh

  • Participant
    Level: Guru
    Posts: 995
    calu on #31141

    Hi Brajesh, thank you very much for suggesting this solution instead of using a hook.

    What I don’t understand using template override, is how I add the position where I want this code to render, eg bp_after_content?

    Regards
    Carsten

  • Keymaster
    (BuddyDev Team)
    Posts: 21785
    Brajesh Singh on #31142

    Hi Carsten,
    When I say template override, It means copying the specific template to your theme/child theme form the BuddyPress template pack and modifying as you please.

    That way you get more flexibility.

    Regards
    Brajesh

  • Participant
    Level: Guru
    Posts: 995
    calu on #31143

    Hi Brajesh, so the position of the tabs is defined by where in the profile loop it is copied into?

    I think I have asked this question before, but something is stil not clear to me; what about the original position of the tabs, should I just hide them with css, or should the code be deleted from the profile loop?

    Thanks

  • Participant
    Level: Guru
    Posts: 995
    calu on #31145

    *where in the profile loop <?php bp_profile_group_tabs(); ?> is pasted into?

  • Participant
    Level: Guru
    Posts: 995
    calu on #31155

    Hi Brajesh, still learning, adding <?php bp_profile_group_tabs(); ?> to the profile-loop.php is not just a simple copy/paste I realised, hope to learn that some day ;-), meanwhile, I think I just add it in a hook, its working perfectly, thanks.

    Regards
    Carsten

  • Keymaster
    (BuddyDev Team)
    Posts: 21785
    Brajesh Singh on #31172

    Hi Carsten,
    I am glad you solved it.

    My suggestion for future is to take a look at the template pack code. That will give you better insight and help in solving many issues.

    Regards
    Brajesh

  • Participant
    Level: Guru
    Posts: 995
    calu on #31175

    Hi Brajesh, thanks for the tip, learning every day πŸ˜‰

    Regards
    Carsten

  • Keymaster
    (BuddyDev Team)
    Posts: 21785
    Brajesh Singh on #31176

    πŸ™‚

You must be logged in to reply to this topic.

This topic is: resolved