You could achieve it with both CSS and preprocess by doing something like this:<br><br>In your template.php file, mytheme_preprocess_node():<br><br>// START<br>$node = $vars['node'];<br><br>if (!empty($node->links['comment_comments'])) {<br>
// Class depending on node comment count.<br> if (!empty($node->comment_count)) {<br> $myclass = 'has-comments';<br> }<br> else {<br> $myclass = 'no-comments';<br> }<br><br> // Add to particular link class.<br>
if (empty($node->links['comment_comments']['attributes']['class'])) {<br> $node->links['comment_comments']['attributes']['class'] = $myclass;<br> }<br> else {<br>
$node->links['comment_comments']['attributes']['class'] .= ' ' . $myclass;<br> }<br><br> // Reformat all links<br> $vars['links'] = !empty($node->links) ? theme('links', $node->links, array('class' => 'links inline')) : '';<br>
}<br>// END<br><br><br>In your theme's css file<br><br>/* START */<br>.has-comments {<br> backgorund-image: url(./images/some-image.png);<br> background-repeat: none;<br> padding-left: 2em;<br>}<br><br>.no-comments {<br>
background-image: none;<br> padding-left: 0;<br>}<br>/* END */<br><br><br><br><br><br><div class="gmail_quote">On Thu, Nov 18, 2010 at 1:01 PM, Salvatore De Paolis <span dir="ltr"><<a href="mailto:iwkse@gmx.com" target="_blank">iwkse@gmx.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div>On Thu, 18 Nov 2010 12:31:23 -0700<br>
Carl Wiedemann <<a href="mailto:carl.wiedemann@gmail.com" target="_blank">carl.wiedemann@gmail.com</a>> wrote:<br>
<br>
> $vars['links'] is generated by theme_links(). Look at<br>
> template_preprocess_node() in includes/theme.inc:<br>
> <a href="http://drupalcode.org/viewvc/drupal/drupal/includes/theme.inc?revision=1.415.2.27&view=markup&pathrev=DRUPAL-6-18-SECURITY#l1955" target="_blank">http://drupalcode.org/viewvc/drupal/drupal/includes/theme.inc?revision=1.415.2.27&view=markup&pathrev=DRUPAL-6-18-SECURITY#l1955</a><br>
><br>
> $variables['links'] = !empty($node->links) ? theme('links',<br>
> $node->links, array('class' => 'links inline')) : '';<br>
<br>
</div>Yes i misunderstood it, i thought it was some kind of overriding<br>
<div><br>
> Unless you absolutely consider the icons to be content and not styling, CSS<br>
> is the way to go instead of <img> tags. Different CSS classes may be applied<br>
> via theme_links() to indicate whether comments exist. CSS also allows for<br>
> the use of sprites.<br>
<br>
</div>As i said in the previous comment, in some cases, i'd want only the icon which<br>
i suppose i can't achieve only with CSS.<br>
</blockquote></div><br>