[buddypress-trac] [BuddyPress] #3484: Inconsistency in action hook position in default theme files

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Wed Aug 17 11:19:25 UTC 2011


#3484: Inconsistency in action hook position in default theme files
-------------------------+-----------------------------
 Reporter:  Jonnyauk     |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Theme        |    Version:
 Severity:  normal       |   Keywords:  2nd-opinion
-------------------------+-----------------------------
 I've been working through the latest trunk release (v1.5-beta2) default
 theme files and have noticed that in a number of files the 'before' and
 'after' area specific action hooks change position in relation to the
 opening and closing 'content' and 'padder' divs.

 I was wondering if there was a reason for this - or maybe just an
 oversight? I'll be happy to patch all the files, but don't want to trawl
 through them all if there is a reason for this!

 In my humble opinion it would make much more sense to follow the code
 pattern in example 1 - where the specific action hooks are inside the
 'content' and 'padder' divs. It would allow anyone adding content into
 this hook to automatically be 'inside' the content and padder divs. There
 are other hooks available if a developer wished to be 'outside' these main
 containing divs.

 Another side-benefit is it makes the theme code a-lot more portable for
 theme and framework developers to surround the BP specific code in their
 own layout definitions. It provides a neat 'chunk' of code that can be put
 inside relevant layout code, rather than having to mess around with all
 the area specific action hooks.

 I have attached a patch example for bp-themes/bp-default/members/index.php

 For instance:

 = Example 1
 file: bp-themes/registration/activate.php
 'before' hook inside 'content' and 'padder' div

 {{{
 1<?php get_header( 'buddypress' ); ?>
 2
 3       <div id="content">
 4               <div class="padder">
 5
 6               <?php do_action( 'bp_before_activation_page' ) ?>
 }}}
 ...
 {{{
 47              <?php do_action( 'bp_after_activation_page' ) ?>
 48
 49              </div><!-- .padder -->
 50      </div><!-- #content -->
 }}}

 = Example 2
 file: bp-themes/members/index.php
 'before' hook outside 'content' and 'padder' div

 {{{
 12<?php get_header( 'buddypress' ); ?>
 13
 14      <?php do_action( 'bp_before_directory_members_content' ); ?>
 15
 16      <div id="content">
 17              <div class="padder">
 }}}
 ...
 {{{
 81              </div><!-- .padder -->
 82      </div><!-- #content -->
 83
 84      <?php do_action( 'bp_after_directory_members_content' ); ?>
 }}}

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/3484>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list