[buddypress-trac] [BuddyPress] #4639: Add template hierarchy support

buddypress-trac noreply at wordpress.org
Sun May 12 06:42:25 UTC 2013

#4639: Add template hierarchy support
 Reporter:  DJPaul       |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  1.8
Component:  Theme        |     Version:  1.7
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
Changes (by r-a-y):

 * keywords:   => has-patch
 * version:   => 1.7


 `refresh.01.patch` is a slightly, different take on what I talked about
 [https://buddypress.trac.wordpress.org/ticket/4639#comment:35 here].

 Technically, I've changed the hook from `'bp_get_root_template'` to
 `'bp_get_buddypress_template'` because it's a more accurate hook to use.

 The hierarchy in the patch looks like this:

 '''Member pages'''

 * members/single/index-action-{action}.php
 * members/single/index-component-{component}.php
 * members/single/index.php

 '''Group pages'''

 * groups/single/index-action-{action}.php
 * groups/single/index-slug-{slug}.php
 * groups/single/index-status-{status}.php
 * groups/single/index.php

 '''Group and Blog creation pages'''

 * groups/index-create.php
 * blogs/index-create.php

 '''Registration and Activation pages'''

 * members/index-register.php
 * members/index-activate.php

 '''All directory pages'''

 * members/index-directory.php
 * groups/index-directory.php
 * blogs/index-directory.php

 Naming convention is still up in the air, but I've stuck with `index.php`
 as the fallback.

 Notice that the creation, registration and directory pages do not have an
 `index.php` fallback.  That's because `index.php` is already used as a
 template part in those directories...  The `index.php` template part is
 inadequately named, but I think it's fine to omit the `index.php` fallback
 for these pages anyway.

 For the member single pages, I omitted the user ID / login / nicename in
 the hierarchy as I don't see much of a benefit in adding them.  I also
 added the context (such as action, component) to the filename.  I'm open
 to removing it.

 Let me know what you think.

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4639#comment:47>
BuddyPress <http://buddypress.org/>

More information about the buddypress-trac mailing list