I want to add a comment form to my view by adding
$node->nid), ‘comment’);
?>
however, it shows up a error saying undefined variable $node->nid, then I realize it is a view not a content type
In the view, by choosing the right url, for example, /projects/{username}/{nodeid}, I only show one content.
so I guess I can get the node id by parsing the 3rd argument of the url, so question might be how to get node id from url in the view
On views page /projects/{username}/{nodeid}
<?php print arg(2);?>will give you node id.Meany nodes can have the same title, you need to use another way, for examlple /projects/{username}/{nodeurl}. But i can’t understand why you use views to display single node? For each node you can create specific patern (just like /projects/{username}/{nodetitle}) for url with module http://drupal.org/project/pathauto then costomize output of the node including comments form and other parts.