Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of Hugo

How can I customize a special group? (19 posts)

Started 1 year, 10 months ago by: nickmy

  • Profile picture of nickmy nickmy said 1 year, 10 months ago:

    Hello

    how can I change the design of a special group,just one not all of them??

    kind regards

  • Profile picture of nickmy nickmy said 1 year, 9 months ago:

    is there a topic here? I couldnt find it?

  • Profile picture of Hugo Hugo said 1 year, 9 months ago:

    Not sure the extent of the customisations that you want to do but you could try this approach:

    Using:
    <?php if(bp_is_groups_component() && ‘my-group-name’ == bp_current_item()): ?>

    to wrap sections of the single groups views e.g I’ve used this to wrap the group-header.php #item-header-avatar and #item-header-content to allow for custom markup followed by an :else to render the normal markup. You could use this principle on various sections of a group view?

    N.B. If copying code directly check the quote marks are correct and not copied as back ticks.

  • Profile picture of nickmy nickmy said 1 year, 9 months ago:

    hi hnla

    thanks for helping. I want to add a background-image where the group description and the group avatar and I also want to have a blank tab instead of the acitivy.

  • Profile picture of Hugo Hugo said 1 year, 9 months ago:

    Well a background image is a styling issue rather than what I showed earlier.

    One approach you coulfd take is to open up /groups/single/home.php find the #item-header div ~ line 9
    <div id=”item-header”>

    change it to this:

    <div id="item-header" class="”>

    That will now output the group name/slug as a class token for all the groups item-headers.

    You can now add a rule set to style a specific background based on this unique class – something like:

    #item-header.my-group-slug {background: url(../images/jpg.jpg) no-repeat 0 0;}

    if you want the background on a nested element then just add to the selector group the child elements:

    #item-header.my-group-slug #item-header-content {}

    Not sure about the blank tab requirement I’m afraid.

  • Profile picture of nickmy nickmy said 1 year, 9 months ago:

    Hello hnla thanks its great !

    okay do you maybe know how I can change the activity.php for a special group??

    I’ve tried this but it doesnt work
    ?php elseif ( bp_group_is_visible() && bp_is_active( ‘activity’ ) ) : ?
    ?php locate_template( array( ‘groups/single/?php bp_group_slug() ?.php’ ), true ) ?

  • Profile picture of Hugo Hugo said 1 year, 9 months ago:

    Not sure about that one, have a vaugish idea but it’s probably better asked of @r-a-y or @djpaul or one of the others

  • Profile picture of r-a-y r-a-y said 1 year, 9 months ago:

    @nickmy – You have the right idea.

    However change bp_group_slug() to bp_get_group_slug().

    locate_template( array( 'groups/single/'. bp_get_group_slug() . '.php' ), true )

  • Profile picture of nickmy nickmy said 1 year, 9 months ago:

    @r-a-y thank you very much yep now it works but I sill need help

    If I use your code I need to create a file for each group otherwise I get a blank page.

    and will this have disadvantages???

  • Profile picture of paulhastings0 paulhastings0 said 1 year, 9 months ago:

    You might consider tweaking the BP Group CSS plugin. Perhaps disable the “Group CSS” admin option except for Site Super-Admins. That way all the group’s default CSS settings will be set to your theme’s CSS files but then you as the Site Super-Admin can individually change the CSS for each group as you please.

  • Profile picture of r-a-y r-a-y said 1 year, 9 months ago:

    @nickmy – That’s actually your code, I just corrected it ;)

    You should do a conditional for only the group you want to modify.

    if ( bp_get_group_slug() == 'YOURSLUG' )
    locate_template( array( 'groups/single/'. bp_get_group_slug() . '.php' ), true )

  • Profile picture of nickmy nickmy said 1 year, 9 months ago:

    thanks :)

    last question @r-a-y
    I tried it also with bp_get_members_slug()
    it doesnt work?

  • Profile picture of Paul Gibbs Paul Gibbs said 1 year, 9 months ago:

    bp_get_members_slug isn’t a function! What info do you want to get, the member’s name or the part of the URL which makes up that link? i.e. “/members/” by default

  • Profile picture of nickmy nickmy said 1 year, 9 months ago:

    yes thats exactly what I want whats the function for that?

  • Profile picture of rustybroomhandle rustybroomhandle said 1 year, 9 months ago:

    I have a plugin that might help:

    http://buddypress.org/community/groups/buddypress-group-css/

    Falls under the category: Slightly rough around the edges but kinda works. :)

    EDIT: Just noticed that paulhastings mentioned it… yay. Update released just yesterday.