4

Using Drupal 7 with a custom made theme, the comments are only showing Subjects, and ignoring the comment body.

In my comment.tpl.php file I have:

<div class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>
<?php print $picture ?>

<?php if ($new): ?>
<span class="new"><?php print $new ?></span>
<?php endif; ?>

<?php print render($title_prefix); ?>
<h3<?php print $title_attributes; ?>><?php print $title ?></h3>
<?php print render($title_suffix); ?>

<div class="submitted">
<?php //print $permalink; ?>
<?php print $submitted; ?>
</div>

<div class="content"<?php print $content_attributes; ?>>
<?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 ?>
</div>
<?php endif; ?>

Any ideas on how to get the comment to show?

1

I found the solution and it was pretty obviously now that I found it. In content type --> Edit --> Comment Display --> The Comment field was hidden! DUH!! :)

0

What you are using is not different from what used from the Bartik theme for its comment template file.

<div class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>

<!-- Omissis -->

<?php if ($new): ?>
  <span class="new"><?php print $new; ?></span>
<?php endif; ?>

<?php print render($title_prefix); ?>
<h3<?php print $title_attributes; ?>><?php print $title; ?></h3>
<?php print render($title_suffix); ?>

<div class="content"<?php print $content_attributes; ?>>
  <?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; ?>
  </div>
  <?php endif; ?>
</div> <!-- /.content —>

I would check if the applied CSS styles are not making the comment body invisible, or if there is a module that, because a bug or not, is not removing the body from comments. The last point is easy to check: If you change the theme, and the comments still show only the title, then it's not a problem with the theme being used.

5
  • I dont see anything in CSS that would hide the comments section. Could the problem be part of my page.tpl.php file:
    – clk1981
    Jul 28 '11 at 17:46
  • I also changed the Theme to Bartik and it still only showed the Comment Subject, without the comment.
    – clk1981
    Jul 28 '11 at 17:49
  • In that case, it's not a problem with the theme, if you didn't alter the Bartik theme. In that case, I would check if there is a module that is causing the problem, but disabling each third-party module you installed.
    – apaderno
    Jul 28 '11 at 17:54
  • I found the solution and it was pretty obviously now that I found it. In content type --> Edit --> Comment Display --> The Comment field was hidden! DUH!! :)
    – clk1981
    Jul 28 '11 at 17:57
  • @clk1981 When you can, add that as answer, and accept it.
    – apaderno
    Jul 28 '11 at 18:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.