BuddyDev

Search

[Resolved] Finding profile fields group id's

  • Participant
    Level: Yogi
    Posts: 1105
    calu on #29550

    Hi Brajesh, how do I find the id’s for my profile fields groups in my button-nav ?

    I want to move these tabs with a hook, like I did with my item-list-tabs here:

    example:
    <li id="change-avatar-personal-li"><a id="change-avatar" href="https://domain/members/me/profile/change-avatar/">change avatar</a></li>

    I guess the markup for these groups are the same, using the class button-nav But then I need the id’s.

    Hovering over these tabs in the inspector does not reveal anything, and in the listing, only the url is listed

    href=”https:/domain/members/username/profile/edit/group/1/”>Profile

    Where do I find the id’s for my groups, group/1/ group/8/ group/12/ group/5/?

    Regards
    Carsten

  • Participant
    Level: Yogi
    Posts: 1105
    calu on #29571

    This is my best shot for the Primary Group:

    <div class="item-list-tabs no-ajax">
     
      <ul>
    
    <li id="subnav"><a id="profile-edit-form" href="https://domain/members/me/profile/edit/group/1/">Profile</a></li>
    
    </ul>
    </div>

    But there is something wrong with the way it links note domain twice:

    https://domain/domain/members/username/profile/edit/group/1/

    Again this tab should only display on own profile, how do I wrap this in?

    Thanks
    Carsten

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #29572

    Hi Carsten,
    That last part(the numeric value) are the field group ids.

    You can always use bp_is_my_profile() to check if it is current user’s own profile.

    Regards
    Brajesh

  • Participant
    Level: Yogi
    Posts: 1105
    calu on #29573

    Hi Brajesh, just id=1?, it’s actually working, but it looks like something is missing, like ´edit-group-1`

    ‘You can always use bp_is_my_profile() to check if it is current user’s own profile.’

    wrapped like this?

    <?php
    if ( bp_is_my_profile() ) {
    	echo "bp_after_profile_content"; // echo edit links here
    }
    ?>

    Regards
    Carsten

  • Participant
    Level: Yogi
    Posts: 1105
    calu on #29575

    Hi Brajesh, I’m sorry, but I can’t get the function to work, is the syntax wrong?

    Regards
    Carsten

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #29576

    Hi Carsten,
    if you are seeing syntax error, you have mostly nested it in another php block. Please share complete code from the file on pastebin and I will assist.

    Regards
    Brajesh

  • Participant
    Level: Yogi
    Posts: 1105
    calu on #29577
    This reply has been marked as private.
  • Participant
    Level: Yogi
    Posts: 1105
    calu on #29590
    This reply has been marked as private.
  • Participant
    Level: Yogi
    Posts: 1105
    calu on #29592
    This reply has been marked as private.
  • Participant
    Level: Yogi
    Posts: 1105
    calu on #29593

    Hi Brajesh, the hook bp_after_profile_field_content is the same for all Profile Fields Groups, but each group has an id.

    Is it possible to add a unique id to the hook, for adding different content to different Profile Fields Groups?

    Regards
    Carsten

The topic ‘ [Resolved] Finding profile fields group id's’ is closed to new replies.

This topic is: resolved