[buddypress-trac] [BuddyPress Trac] #7372: Add page for Member Type directory listing

buddypress-trac noreply at wordpress.org
Sat Dec 3 10:50:48 UTC 2016


#7372: Add page for Member Type directory listing
--------------------------+----------------------------------
 Reporter:  Venutius      |       Owner:
     Type:  enhancement   |      Status:  new
 Priority:  normal        |   Milestone:  Under Consideration
Component:  Members       |     Version:  2.3.0
 Severity:  normal        |  Resolution:
 Keywords:  dev-feedback  |
--------------------------+----------------------------------
Changes (by slaFFik):

 * keywords:   => dev-feedback
 * version:   => 2.3.0
 * milestone:  Awaiting Review => Under Consideration


Comment:

 I'm not sure we will go this route - give for each member type an own
 WordPress page.
 As your main concern seems to be around styling and templating, we can
 append a new `<body>` class like `member-type-students` in addition to the
 current `directory type members`.

 Also, you can easily change the whole page template for a directory using
 a code like this:

 {{{#!php
 <?php
 function venutius_7372_change_page_template() {
     if ( bp_is() ) {
         add_filter( 'template_include', function ( $template ) {
             $new_template = locate_template( array( 'page-templates
 /member-type-students.php' ) );
                 if ( ! empty( $new_template ) ) {
                     return $new_template;
                 }

                 return $template;
         }, 99 );
     }
 }

 add_action( 'wp', 'venutius_7372_change_page_template' );
 }}}

 You can also redefine only particular BuddyPress part of the member type
 directory using this:
 https://codex.buddypress.org/themes/theme-compatibility-1-7/template-
 hierarchy/#member-directory-page

 {{{
 /buddypress/members/index-directory-type-{member_type}.php when viewing
 member type specific directory page, {member_type} is the current member
 type.
 }}}

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7372#comment:1>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list