summaryrefslogtreecommitdiff
path: root/modules/comment/comment.tpl.php
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-07-28 10:09:25 +0000
committerDries Buytaert <dries@buytaert.net>2009-07-28 10:09:25 +0000
commit51e638912257eb25fa3ada96777b14573e7d28b5 (patch)
treea042a1ea0909f01e9f7d225e6183cefa615e2719 /modules/comment/comment.tpl.php
parent0ae1c4d9b77ef68a1c3f81ee32f01464a37df3e9 (diff)
downloadbrdo-51e638912257eb25fa3ada96777b14573e7d28b5.tar.gz
brdo-51e638912257eb25fa3ada96777b14573e7d28b5.tar.bz2
- Patch #523950 by moshe weitzman, yched, catch: update comment rendering to take full advantage of the drupal_render() paradigm.
Diffstat (limited to 'modules/comment/comment.tpl.php')
-rw-r--r--modules/comment/comment.tpl.php16
1 files changed, 11 insertions, 5 deletions
diff --git a/modules/comment/comment.tpl.php b/modules/comment/comment.tpl.php
index 07360a044..abcca9378 100644
--- a/modules/comment/comment.tpl.php
+++ b/modules/comment/comment.tpl.php
@@ -7,9 +7,11 @@
*
* Available variables:
* - $author: Comment author. Can be link or plain text.
- * - $content: Body of the post.
+ * - $content: An array of comment 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.
* - $date: Date and time of posting.
- * - $links: Various operational links.
* - $new: New comment marker.
* - $picture: Authors picture.
* - $signature: Authors signature.
@@ -46,7 +48,7 @@
<div class="<?php print $classes; ?> clearfix">
<?php print $picture ?>
- <?php if ($comment->new): ?>
+ <?php if ($new): ?>
<span class="new"><?php print $new ?></span>
<?php endif; ?>
@@ -57,7 +59,11 @@
</div>
<div class="content">
- <?php print $content ?>
+ <?php
+ // We hide the comments and links now so that we can render them later.
+ hide($content['links']);
+ print render($content);
+ ?>
<?php if ($signature): ?>
<div class="user-signature clearfix">
<?php print $signature ?>
@@ -65,5 +71,5 @@
<?php endif; ?>
</div>
- <?php print $links ?>
+ <?php print render($content['links']) ?>
</div>