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

buddypress-trac noreply at wordpress.org
Fri Nov 2 07:01:34 UTC 2012


#4639: Add template hierarchy support
--------------------------+------------------------------
 Reporter:  DJPaul        |       Owner:
     Type:  enhancement   |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Theme         |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  dev-feedback  |
--------------------------+------------------------------

Comment (by r-a-y):

 Paul, in 4639-ray.03.patch, I've changed the location of the custom
 templates as well as the filenames to be more granular.

 Here are some examples:

 {{{
 members/single/custom/nicename-{user_nicename}.php
 members/single/custom/id-{user_id}.php
 members/single/custom/component-{component}.php
 }}}


 First, I've moved custom templates under a subdirectory called `"custom"`.
 This is so you can easily keep track and tell what overrides you've made
 in your theme.

 The second change is the prefixing of the template with the parameter.
 The reason for this change is previously it was possible for a user to
 have a user_nicename of "1" but have a different user ID altogether.  This
 would mean that a user with user ID "1" would share the same template with
 user_nicename "1".  This is a no-no and I'm surprised that this isn't
 really addressed in WordPress' own template hierarchies!

 I've added in a component check for the members component because some
 theme devs might want to style certain components differently (such as
 messages or settings).

 Let me know what you think.

 ---

 > IMO it's not out of the question to release 1.7 without
 activity/permalink-{activity_type}, but then to refactor activity as
 described above for 1.8 and introduce activity-type-specific templates as
 an enhancement then.

 I feel the same way; it would be nice to address this in 1.7, but if we
 don't have time, then 1.8 is fine with me as well.

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


More information about the buddypress-trac mailing list