0

Currently example.com/comment/# shows the contents of the node that the comment is posted to. I want the page to only show the comment.

I'm assuming the page does not theme via .tpl.php. And if it isn't, do I put something like this in the template.php, and how do I override the current content of that page:

$comment = _comment_load($cid);
return theme('comment',$comment);

1 Answer 1

0

There's no conventional way of doing this as far as I'm aware but if you want to do this it can probably be achieved with some processing in your theme.

function THEME_preprocess_page(&$variables) {

  // DO SOMETHING WITH request_uri() or similar

  if (isset($SOME_VARIABLE)) {
     $variables['theme_hook_suggestions'][] = "page__comments";
  }
}

Then create a copy of your page template as page--comments.tpl.php and take out what you dont need.

This is nasty though and not the 'Drupal' way of doing things.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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