Skip to:
Content
Pages
Categories
Search
Top
Bottom

Group Hierarchy Breadcrumbs

  • Avatar of johnnymestizo
    johnnymestizo
    Participant

    @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] > > >

    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

Viewing 15 replies - 1 through 15 (of 15 total)
  • Avatar of David Dean
    David Dean
    Participant

    @ddean

    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.

    Avatar of johnnymestizo
    johnnymestizo
    Participant

    @johnnymestizo

    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

    I added

    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 ‘

    ‘.bp_group_hierarchy_get_breadcrumbs().’

    ‘;`

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

    Avatar of johnnymestizo
    johnnymestizo
    Participant

    @johnnymestizo

    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

    Avatar of johnnymestizo
    johnnymestizo
    Participant

    @johnnymestizo

    Any ideas?

    Avatar of David Dean
    David Dean
    Participant

    @ddean

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

    Avatar of johnnymestizo
    johnnymestizo
    Participant

    @johnnymestizo

    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

    Avatar of johnnymestizo
    johnnymestizo
    Participant

    @johnnymestizo

    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

    Avatar of johnnymestizo
    johnnymestizo
    Participant

    @johnnymestizo

    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

    Avatar of Vernon Fowler
    Vernon Fowler
    Participant

    @vernonfowler

    @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. :)

    Avatar of johnnymestizo
    johnnymestizo
    Participant

    @johnnymestizo

    Hi Dean,

    Any idea why it doesn’t work for me?

    I am keen to run this still…

    Cheers,

    Johnny

    Avatar of johnnymestizo
    johnnymestizo
    Participant

    @johnnymestizo

    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

    Avatar of David Dean
    David Dean
    Participant

    @ddean

    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/

    Avatar of johnnymestizo
    johnnymestizo
    Participant

    @johnnymestizo

    This works awesome now! Thanks David.

    Avatar of johnnymestizo
    johnnymestizo
    Participant

    @johnnymestizo

    Hi David

    Still trying to get all the breadcrumb separators to be

    >

    Please see here to see my issue:

    http://tradr.com/groups/electronics/phones/mobiles/apple-iphone/iphone-5/buy/?buy=ebay

    You guide says this should work but I couldnt get it working.

    ‘bp_group_hierarchy_get_breadcrumbs( $separator = ‘|’, $group = false )’

    Any ideas?

    Johnny

Viewing 15 replies - 1 through 15 (of 15 total)

You must be logged in to reply to this topic.