Hello,

I can't find of to add the nodecomment edit form in a template of a content type.

I can add the default comment edit form of drupal core:
print drupal_get_form('comment_form', array('nid' => arg(1)));

Any idea?

Thanks :)

Comments

ykyuen’s picture

Try this

crea’s picture

Status: Active » Fixed

You are trying to use comment form from the Comment module. Ofcourse it doesn't work. Try to use the nodecomment form.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jthomasbailey’s picture

Version: 6.x-2.x-dev » 6.x-3.x-dev
Status: Closed (fixed) » Active

#1 works:


<?php
    if (function_exists('nodecomment_render') && $node->node_comment) {
      print nodecomment_render($node, $node->cid);
      $node->node_comment = NULL;
    }
    ?>  

But it outputs the comments & page title as well as the form. The unnecessary stuff can be hidden with CSS but that's not a very good way of doing it, is there a way of just printing the form? If not mark this as a feature request.

jthomasbailey’s picture

The solution is simple:

<?php print $comment_form = nodecomment_form($node);?>
crea’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.