Skip to:
Content
Pages
Categories
Search
Top
Bottom

How can I customize a special group?

  • @nickmy

    Participant

    Hello

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

    kind regards

Viewing 18 replies - 1 through 18 (of 18 total)
  • @nickmy

    Participant

    is there a topic here? I couldnt find it?

    @hnla

    Participant

    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.

    @nickmy

    Participant

    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.

    @hnla

    Participant

    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.

    @nickmy

    Participant

    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 ) ?

    @hnla

    Participant

    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

    @r-a-y

    Keymaster

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

    @nickmy

    Participant

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

    @paulhastings0

    Participant

    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.

    @r-a-y

    Keymaster

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

    @nickmy

    Participant

    thanks :)

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

    @djpaul

    Keymaster

    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

    @nickmy

    Participant

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

    @rustybroomhandle

    Participant

    I have a plugin that might help:
    https://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.

    @nickmy

    Participant

    thanks but now whats the function @djpaul

    @r-a-y

    Keymaster

    Use BP_MEMBERS_SLUG as it’s a constant.

    eg.
    echo 'This is my cool ' . BP_MEMBERS_SLUG . ' slug for members';

    @nickmy

    Participant

    @r-a-y or @djpaul

    it doesnt work here??
    ?php elseif ( ‘ . BP_MEMBERS_SLUG . ‘ == ‘admin’ ) : ?
    ?php locate_template( array( ‘groups/single/’ . BP_MEMBERS_SLUG . ‘.php’ ), true ) ?

    @djpaul

    Keymaster

    That’s invalid PHP syntax. You probably want:

    elseif ( BP_MEMBERS_SLUG == ‘admin’ )

Viewing 18 replies - 1 through 18 (of 18 total)
  • The topic ‘How can I customize a special group?’ is closed to new replies.
Skip to toolbar