Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • @claudiosinopoli

    Participant

    Dear danbp,
    first of all tank you for killing the discussion with your silence.
    Almost two months ago I asked you for help, without success.

    After a while I realized that I can perform a supposedly so simple task myself.
    I’m writing now to inform other people that want the “create a group” button in the single member’s “groups” page or somewhere else in a buddypress template page.

    After reading some buddypress documentation I replicated in my child theme the buddypress templates and css folders structure.

    Looking into the group-related php files I noticed that the function for the button “create a group” is called bp_groups_directory_group_filter.

    The “groups” page for the single member is generate by the file located in the following folder in my child theme: my_child_theme/buddypress/members/single/groups.php

    It is starting with the following code

    <?php
    /**
     * BuddyPress - Users Groups
     *
     * @package BuddyPress
     * @subpackage bp-legacy
     */
    
    ?>
    <div class="item-list-tabs no-ajax" id="subnav" role="navigation">
    	<ul>
    		<?php if ( bp_is_my_profile() ) bp_get_options_nav(); ?>
    		
    		<?php if ( !bp_is_current_action( 'invites' ) ) : ?>
    
    			<li id="groups-order-select" class="last filter">
    
    				<label for="groups-order-by"><?php _e( 'Order by:', 'buddypress' ); ?></label>
    				<select id="groups-order-by">
    					<option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option>

    It’s enough to add the line
    <?php do_action( 'bp_groups_directory_group_filter' ); ?>
    after line 12
    <?php if ( bp_is_my_profile() ) bp_get_options_nav(); ?>
    and you do the trick.

    Now in the single member’s “groups” page there will be the following buttons:
    Memberships | Invitations | Create a group

    In the same way you can add this button to any other template page, taking care that the function it’s placed in the right position in the code.

    Thank you again danbp: your silence was not very professional but perhaps stimulating in order to take initiative, learn something and solve a problem by myself.

    @claudiosinopoli

    Participant

    Hi,
    thanks for your reply.
    Actually http://www.claudiosinopoli.com/sinergy/members/aldo/groups/ is not “inside an existing group” but just the page “Groups” inside my profile.. let’s call it “My Groups”.
    The page inside an existing group has as url http://www.claudiosinopoli.com/sinergy/groups/aldos-test-group/
    Anyway I understand that the button is not supposed to be there.
    Now my question is: is it possible to add some script in oder to have the button “Create a Group” also after “Membership” | “Invitation” in the so called My Gropus page?
    It would be more user friendly to have the possibility to add a new group also from there.
    Can you help me with that?
    Thanks!

    @claudiosinopoli

    Participant

    Hi danbp!
    Thanks for your prompt reply.

    Replying your questions:
    – Yes, group creation is allowed for all users
    – Yes, it works in the usermenu

    You can visit my website at http://www.claudiosinopoli.com/sinergy/ and login with the following
    user: aldo
    pwd: aldo

    As you can see if you are in the page http://www.claudiosinopoli.com/sinergy/groups/ you get the button but when you are in http://www.claudiosinopoli.com/sinergy/members/aldo/groups/ the button is missing.

    The same is happening with the Twenty-Sixteen (see HERE)

    If required I can give you admin access.

Viewing 3 replies - 1 through 3 (of 3 total)
Skip to toolbar