BuddyDev

Search

[Resolved] Show the group type of group in a map by bindPopup

Tagged: 

  • Participant
    Level: Initiated
    Posts: 7
    Alejandro on #34561

    Hi, thank you very much for the great support you give in this forum πŸ™‚
    I am using bp-create-group-type pluging. I am working on showing the location of the groups on a map, and I would like that when clicking on the position of a group on the map it would give me the information of the type of group, assigned to each group. I know it is not your development but maybe you can give me a clue where to look …

    I am using this code to show the result on the map but i dont know wich “function I sould call”….

    marker<?php echo $group_id ?>.bindPopup('<b><a href="<?php bp_group_permalink(); ?>"><?php bp_group_name(); ?></a></b><b><a href="<?php bp_group_permalink(); ?>"><p>Group type:</p><?php function I sould call(); ?></a></b><?php echo $group_location; ?><br>');

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2933
    Ravi on #34566

    Hello Alejandro,

    Thank you for posting. To get the type of group BuddyPress has a function with name ‘bp_groups_get_group_type’. Please take a took.

    Regards
    Ravi

  • Participant
    Level: Initiated
    Posts: 7
    Alejandro on #34573

    Thank Ravi, when i use this function , the screem only show me the main header…but the rest desapear…I dont know the reasson , because i look at the codex.buddypress.org documentation and you was rigth…sould be the “funtion bp_groups_get_group_type()” The console doesΒ΄t give me any clue…
    I prove with other fuction like “bp_group_avatar_thumb()” and its work showing the group avatar…but with the type of group, i dont know…

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

    Hi Alejandro ,

    You will need to pass the group id to the function like this

    
    echo bp_groups_get_group_type( $group_id, true );
    
    

    Pass a value for the $group_id. The second parameter determines if it returns single value or an array.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 7
    Alejandro on #34602

    Works perfectly ;)…i was block with this for time…now works πŸ™‚
    Thanks very much for the help and your atention.
    My best wishes
    Regards

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

    You are welcome.
    I am glad you got it all working πŸ™‚

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: resolved