diff options
author | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-08-15 05:32:46 +0000 |
---|---|---|
committer | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-08-15 05:32:46 +0000 |
commit | b8f36e1c6ab9d00a4d8b2d1910e83a0f71770eca (patch) | |
tree | 0b54008c463a2af56f9d81f309e28bc4abaa84b1 /themes/engines/phptemplate | |
parent | bf3487c0b1502aca78e91f7217b160b4242ec6c7 (diff) | |
download | brdo-b8f36e1c6ab9d00a4d8b2d1910e83a0f71770eca.tar.gz brdo-b8f36e1c6ab9d00a4d8b2d1910e83a0f71770eca.tar.bz2 |
#77184 by Eaton, look for specific block templates based on region, module, and delta.
Diffstat (limited to 'themes/engines/phptemplate')
-rw-r--r-- | themes/engines/phptemplate/phptemplate.engine | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/themes/engines/phptemplate/phptemplate.engine b/themes/engines/phptemplate/phptemplate.engine index 669b27ada..5b39ab229 100644 --- a/themes/engines/phptemplate/phptemplate.engine +++ b/themes/engines/phptemplate/phptemplate.engine @@ -143,7 +143,9 @@ function phptemplate_features() { /** * Prepare the values passed to the theme_page function to be passed - * into a pluggable template engine. + * into a pluggable template engine. Uses the arg() function to + * generate a series of page template files suggestions based on the + * current path. If none are found, the default page.tpl.php is used. */ function phptemplate_page($content) { @@ -220,6 +222,16 @@ function phptemplate_page($content) { $variables['node'] = node_load(arg(1)); } + // Build a list of suggested template files in order of specificity. One + // suggestion is made for every element of the current path, though + // numeric elements are not carried to subsequent suggestions. For example, + // http://www.example.com/node/1/edit would result in the following + // suggestions: + // + // page-node-edit.tpl.php + // page-node-1.tpl.php + // page-node.tpl.php + // page.tpl.php $i = 0; $suggestion = 'page'; $suggestions = array($suggestion); @@ -300,10 +312,17 @@ function phptemplate_comment($comment, $links = 0) { /** * Prepare the values passed to the theme_block function to be passed - * into a pluggable template engine. + * into a pluggable template engine. Uses block properties to generate a + * series of template file suggestions. If none are found, the default + * block.tpl.php is used. */ function phptemplate_block($block) { - return _phptemplate_callback('block', array('block' => $block)); + $suggestions[] = 'block'; + $suggestions[] = 'block-' . $block->region; + $suggestions[] = 'block-' . $block->module; + $suggestions[] = 'block-' . $block->module . '-' . $block->delta; + + return _phptemplate_callback('block', array('block' => $block), $suggestions); } /** |