Community Documentation

Link to Parent-comment

Last updated November 15, 2010. Created by husztisanyi on November 15, 2010.
Log in to edit this page.

This code into the comment.tpl.php make a link to the parent comment:

<?php if ($comment->pid):
$parent_comment = db_result(db_query('SELECT subject FROM {comments} WHERE cid = %d AND status = %d', $comment->pid, COMMENT_PUBLISHED));
print 
'<a href="' . $node_url . '#comment-' . $comment->pid.'" title="' . $parent_comment .'" >' . t('Pre') . '</a>';
endif;
?>

About this page

Drupal version
Drupal 6.x

Theming Guide

Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.