Posted by Asitis on July 11, 2008 at 1:32pm
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
Comments
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>Responsive Drupal Themes | Drupal 8 Design Initiative | Certified to Rock
does this code deal with all
does this code deal with all the permissions of viewing comments as well?
Free Chemistry Tutoring
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.
Responsive Drupal Themes | Drupal 8 Design Initiative | Certified to Rock
what would you do to show
what would you do to show how many comments a node has already?
Free Chemistry Tutoring