Closed (fixed)
Project:
Drupal core
Version:
x.y.z
Component:
Other
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
28 Feb 2002 at 13:11 UTC
Updated:
1 Dec 2010 at 09:53 UTC
currently, the marking of new comments is done by adding
<span style="color: red;">*</span>
to an unread comments subject. this is bad mingling of code and layout, may mess up themes (imagine a red background!), messes up comments a la <!-- $subject --> (which becomes <!-- <span ...> -->, which is invalid html) and should really be moved to the theme.
why not just add a new field "$new" to $comment which can be evaluated by theme.comment()?
Comments
Comment #1
polaar@www.drop.org commentedWhy not a more general markup function in the theme, that can be used like this:
$theme->mark("this is a new comment")This way, it can be used in other places too (number of new submissions, error messages etc...)kbd
The theme decides how to format "marked" text. To make this more flexible, a second argument should be added to indicate the type ("mark as..."), like this:
$theme->mark("this is a new comment","newcomment")or
$theme->mark("this is an error message","error")The theme could then decide whether to write:
this is a new comment<span style="color: red">*</span>
or
<span style="color: red">this is an error message</span>
or even just use the type as a css class like this:
<span class="newcomment">this is a new comment</span>
Any thoughts on this?
Comment #2
marco commentedThis is fixed in the comment module in my sandbox. The comment object passed to themes has a $new attribute which is 1 if the comment is new. The theme then renders the comment as it wishes.
Comment #3
moshe weitzman commentedComment #4
ax commented