Hello,

Is the node comment themable? If so does it use a commentnodename-node.tpl.php or just comments.tpl.php?

G

Comments

asghar’s picture

Hi
Can we theme node comments ? Have you find any solution?

tommytom’s picture

looking also for the answer ...

asghar’s picture

tommytom
hello we solve this problem by view 2

quicksketch’s picture

You can take two approaches: You can theme the view (as suggested by asghar) or you can theme the node-comment.tpl.php file. In Drupal 6 we also provide .tpl.php files for node-comment.tpl.php and nodecomment-wrapper.tpl.php. Just copy them to your theme's directory, clear the Drupal caches, and change as necessary.

quicksketch’s picture

Status: Active » Fixed

Moving to fixed, please reopen if you have further questions on this subject.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

abaddon’s picture

Version: 5.x-1.1 » 6.x-2.0-beta6
Status: Closed (fixed) » Active

to theme the comment wrapper, you would use comment-wrapper.tpl.php, this works as expected

ive tried to copy node-comment.tpl.php to my theme folder and it doesnt take, i did drush cc all, if i modify the file directly in the nodecomment/ folder, then it works, but this shouldnt be the solution
ive tried renaming it to node-content-type-user-as-comment.tpl.php and didnt work either, or node-comment-content-type or even comment .tpl.php
any ideas why?
ive tried to remove nodecomment/node-comment.tpl.php and then i just get a default node styling for node comments and my theme's tpls arent parsed

my theme is a subtheme of typebased

edit: the content types used are custom, not the comment content type created by the module, yet nodecomment/node-comment.tpl.php is parsed.. how does this work exactly

well it seems i needed to copy node.tpl.php as well from my base theme, after that all the logic works, i used a template name to override a specific content type only

quoting from http://drupal.org/node/190815

Note that in order to override the template for a specific node type, the theme must also implement the base node.tpl.php file. If this file is omitted, the theme will not detect the presence of node-[type].tpl.php files.

abaddon’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Jb33’s picture

Status: Closed (fixed) » Active

Based on this thread I could not get things working my Zen subtheme. I tried to modify these files without success:

subtheme/node-comment.tpl.php
subtheme/templates/node-comment.tpl.php
subtheme/node-mycommenttype.tpl.php
subtheme/templates/node-mycommenttype.tpl.php

Theme registry was cleared between attempts. Can you help me with this?

Miguel Pereira’s picture

Did you take in consideration what abaddon indicated on #7? a node.tplp.php file must be present for a node-comment.tpl.php to work.

abaddon’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.