Plugin: BP Group Hierarchy

Join this plugin group to follow comments, support topics and reviews.

Group Hierarchy Breadcrumbs (14 posts)

Started 5 months, 3 weeks ago by: johnnymestizo

  • Hi

    I love using group hierarchy in buddypress. it should be included in the BP build !

    Is it possible to get a php function to call a breadcrumbs feature?

    So the output would be group title links like the following:

    [Main Group] > [Sub Group 1] > [Sub Group 2] > [Sub Group 3]

    Each group is a clickable link. It obviously would show the CURRENT group and parent groups that the user has navigated to.

    Good idea bad idea?

    Cheers

    Johnny

  • Profile picture of David Dean David Dean said 5 months, 3 weeks ago:

    You can use the bp_group_hierarchy_breadcrumbs() function to display this.

    The documentation incorrectly says that this function RETURNS this text, when in fact it ECHOES it.

  • Hi

    Thanks

    I tried to throw the following in my header:

    echo bp_group_hierarchy_breadcrumbs();
    bp_group_hierarchy_breadcrumbs();

    It caused the white screen of death.

    This is when I was in the root of my site (not a group).

    Forgive my poor coding skills but is there a way to display the breadcrumb even if it is at the home path?

    And, get the original request working ?

    Cheers

    Johnny

  • Profile picture of 3dperuna 3dperuna said 5 months, 2 weeks ago:

    I added

    <?php echo bp_group_hierarchy_breadcrumbs(); ?>

    to my single/group-header.php file and it works fine.

    The problem is styling it. I added the following to bp-group-hierarchy-template.php at line 171:

    Original: echo bp_group_hierarchy_get_breadcrumbs();

    New: echo '<div class="bpgh_breadcrumbs">'.bp_group_hierarchy_get_breadcrumbs().'</div>';

    And then added the pbgh_breadcrumbs class to my style sheet. It worked well. Might I suggest a similar revision for the next update?

  • Hi the above php worked for me

    however, the function keeps outputting a rubbish link

    Why isn’t it specifying anything within the anchor? this happens regards of if i am at root, at groups, at sub group, at sub sub group.

    ?

    Any ideas?

    Cheers

    Johnny

  • Any ideas?

  • Profile picture of David Dean David Dean said 5 months, 1 week ago:

    @johnnymestizo – can you provide an example of the “rubbish link” that is being generated? That would be helpful in troubleshooting.

  • Hi @DDean

    I got breadcrumbs working in single/group-header.php

    However, I would like to call it from my header.php or functions.php file.

    As, I want to insert breadcrumbs in the top menu bar of my site.

    Is this function only support in the group loop?

    Cheers

    Johnny

  • Never mind, i have ripped my wp menu apart and placed the bp_group_hierarchy_get_breadcrumbs() as a menu to replace it, when bp_is_group() is true

    Cheers,

    Johnny

  • Hi,

    I have made this group in my header bar.

    div id=”tradr-group-breadcrumbs

    Please go to http://tradr.com/groups/ and see it not work correctly.

    Any ideas?

    Johnny

  • Profile picture of Vernon Fowler Vernon Fowler said 2 months, 3 weeks ago:

    @3DPeruna your solution worked well for me. Thank you kindly. The only difference I made is to include the wrapping div in my child theme’s single/group-header.php rather than mess with the plugin code itself (in bp-group-hierarchy-template.php). We already need to add the php echo into the child theme file so I thought we might as well slot the wrapping div there too.

    It probably is better still to use child-theme/functions.php and lever off the bp_before_group_header_meta action hook but this will do for now.

    I was originally looking for a parent group widget but this is better as it makes sense to see the complete hierarchy line of parent groups. Nice work. :)

  • Hi Dean,

    Any idea why it doesn’t work for me?

    I am keen to run this still…

    Cheers,

    Johnny

  • Hi

    Can you check out my page and see the source code output?

    http://tradr.com/groups/

    Any idea why this does not work?

    Many thanks,

    Johnny

  • Profile picture of David Dean David Dean said 1 month, 2 weeks ago:

    Hi all,

    I’ve posted a short write-up on adding breadcrumbs to your group pages. It’s pretty straightforward – as you all have already discovered, there’s no way around a child theme. But there still seems to be a lot of confusion, so I hoped this would straighten things out.

    http://www.generalthreat.com/2012/04/extending-buddypress-group-hierarchy-adding-breadcrumbs-to-your-theme/