Add the "Add comment link" and/or "(2) Comments" link
Asitis - July 11, 2008 - 13:32
Hey,
I'm working on a project for a big Drupal based site, including a totally custom made layout. I've based this layout upon Grid Inspired ( http://drupal.org/project/grid_inspired ).
It all works swell, except for the fact I can't figure out how to add "Add a new comment" link to the end of each post.
In Wordpress there is a simple template tag for this (something like 'get_comments'), and Im not really that experienced with Drupal..
Is there any kind of (easy) way of adding such a link to the end of each post?
I found out other themes had such links, but I cant figure out where or how they are called..
Thnx

Well, you can print the
Well, you can print the links variable:
<?phpif ($links) {
print $links;
}
?>
Or you can just print the link to the comment form, something like this:
<a href="http://example.com/<?php print $node->links['comment_add']['href'] ?>" title="<?php print $node->links['comment_add']['attributes']['title'] ?>">Add your comment</a>does this code deal with all
does this code deal with all the permissions of viewing comments as well?
That's a link to the comment
That's a link to the comment form, for adding a comment.
To control the viewing of comments, such as preventing anonymous users from viewing comments, set the permissions in User Management > Access Control.
In any case the snippet is just printing what is already available in the node, so if its not available, nothing should print.
what would you do to show
what would you do to show how many comments a node has already?