Skip to:

Adding group ID to activity lists

  • Shmoo


    I’m almost done customization of the entire Groups section and next in line is the Activity section the only problem I face right now is I can’t add the related group-ID’s to the activity lists.

    This probably will be because i’m not inside the Groups -Loop anymore but inside the Activity -Loop.

    Why I need those ID -numbers ?

    At the Groups pages i’ve added the <?php bp_groups_id(); ?> a couple of times to some HTML classes and by doing so I could target each list or div individually by CSS and it’s group-ID.
    Now I have giving each group it’s own coloring based on simple CSS borders like this.


    Each group has it’s own 3 border-colors and I would like to show those colors again at the bottom of each Activity item. This way people can see very clearly what ‘team -stream’ the Activity is about.

    I have two options I can think of

    1 )
    This will probably be the most simple one.
    I try to add the Activity name ( group-name ) to a HTML class and by doing so could target the list by the group-name in classes. Example { border-stuff }
    – Not very pretty but it gets the jobs done.

    2 )
    I duplicate the groups-loop.php, rename it, minify it with less tags and only the <?php bp_group_id(); ?> inside it and call it or include it by <?php bp_get_template_part('duplicated-groups-loop'); ?> from the activity-loop.php ?? I don’t know if thats a very smart move and if it’s allowed to do so ?

    3 )
    Maybe somebody else has a better option ?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Adding group ID to activity lists’ is closed to new replies.
Skip to toolbar