By jstarek on
Hello everybody,
I'm taking my first steps into modifying existing themes. On http://jstarek.de/ I use Roopletheme's LiteJazz theme as a basis. In order to have comment counts shown below blog posts (like Wordpress et al. do it), I edited the theme's node.tpl.php to include
<?php if ($links) { ?>
<div class="links">
<!-- only the following line was added -->
<?php print "<a href=\"".$node_url."\">".$node->comment_count." Kommentare"."</a> &emdash;"; ?>
<?php print $links?>
</div>
<?php }; ?>
I have two problems with this:
- The line with the comment numbers is shown for all blocks, even those where I have comments disabled. What property can I check in order to have it appear only for nodes of a specific type (in my case, blog posts) or only for nodes where commenting is allowed?
- How can I make the word "Kommentare" translatable?
Many thanks in advance!
Jürgen
Comments
1.- you're checking that the
1.- you're checking that the node has links, then if it has any link (such as taxonomy), the link will apear
2.- to make text translatable, use t() function( see drupal api for detailed reference )
it is better to create links with l()function
the code would be like this:
i hope this will help you :)
good luck!!!
Thanks for your hints!
Thanks for your hints! Meanwhile, I also finally discovered where the complete function reference for Drupal is located (namely, http://api.drupal.org/api/functions/5 ) and with the help of that info, I think I'll get ahead.
Regards,
Jürgen