Skip to:
Content
Pages
Categories
Search
Top
Bottom

How can I customize a special group?

  • Avatar of nickmy
    nickmy
    Participant

    @nickmy

    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)
  • Avatar of nickmy
    nickmy
    Participant

    @nickmy

    is there a topic here? I couldnt find it?

    Avatar of Hugo
    Hugo
    Moderator

    @hnla

    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.

    Avatar of nickmy
    nickmy
    Participant

    @nickmy

    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.

    Avatar of Hugo
    Hugo
    Moderator

    @hnla

    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.

    Avatar of nickmy
    nickmy
    Participant

    @nickmy

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

    Avatar of Hugo
    Hugo
    Moderator

    @hnla

    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

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

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

    Avatar of nickmy
    nickmy
    Participant

    @nickmy

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

    Avatar of paulhastings0
    paulhastings0
    Participant

    @paulhastings0

    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.

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

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

    Avatar of nickmy
    nickmy
    Participant

    @nickmy

    thanks :)

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

    Avatar of Paul Gibbs
    Paul Gibbs
    Keymaster

    @djpaul

    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

    Avatar of nickmy
    nickmy
    Participant

    @nickmy

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

    Avatar of rustybroomhandle
    rustybroomhandle
    Participant

    @rustybroomhandle

    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.

    Avatar of nickmy
    nickmy
    Participant

    @nickmy

    thanks but now whats the function @djpaul

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    Use BP_MEMBERS_SLUG as it’s a constant.

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

    Avatar of nickmy
    nickmy
    Participant

    @nickmy

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

    Avatar of Paul Gibbs
    Paul Gibbs
    Keymaster

    @djpaul

    That’s invalid PHP syntax. You probably want:

    elseif ( BP_MEMBERS_SLUG == ‘admin’ )

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

You must be logged in to reply to this topic.