From 4d202669af4d2cc64244d70fe064aef6c50c1b23 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Thu, 18 Jun 2009 21:19:02 +0000 Subject: #455844 by yched, JohnAlbin, moshe weitzman, Frando, et al: Allow more granular theming of drupal_render()ed elements. --- modules/node/node.module | 12 ------------ modules/node/node.tpl.php | 22 +++++++++++++++------- 2 files changed, 15 insertions(+), 19 deletions(-) (limited to 'modules/node') diff --git a/modules/node/node.module b/modules/node/node.module index 85bcceb36..ad7bedbe5 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1247,18 +1247,6 @@ function template_preprocess_node(&$variables) { unset($node->content['links']); } - // Render taxonomy links separately. - $variables['terms'] = !empty($node->content['links']['terms']) ? drupal_render($node->content['links']['terms']) : ''; - - // Render all remaining node links. - $variables['links'] = !empty($node->content['links']) ? drupal_render($node->content['links']) : ''; - - // Render any comments. - $variables['comments'] = !empty($node->content['comments']) ? drupal_render($node->content['comments']) : ''; - - // Render the rest of the node into $content. - $variables['content'] = drupal_render($node->content); - // Flatten the node object's member fields. $variables = array_merge((array)$node, $variables); diff --git a/modules/node/node.tpl.php b/modules/node/node.tpl.php index 92e6c128e..49979a22d 100644 --- a/modules/node/node.tpl.php +++ b/modules/node/node.tpl.php @@ -7,7 +7,10 @@ * * Available variables: * - $title: the (sanitized) title of the node. - * - $content: Node body or teaser depending on $teaser flag. + * - $content: An array of node items. Use render($content) to print them all, or + * print a subset such as render($content['field_example']). Use + * hide($content['field_example]) to temporarily suppress the printing of a + * given element. * - $comments: the themed list of comments (if any). * - $picture: The authors picture of the node output from * theme_user_picture(). @@ -78,17 +81,22 @@ - -
+ +
- +
- + - + - \ No newline at end of file + -- cgit v1.2.3