Hi,
I've created a custom menu in a custom module of mine, with items of course.
I wanted to add the comment form (of the Comment module) to the page that my item takes me to.
The problem is that the page i'm redirected to is not a node, but it is a render-able page that displays the data according to it's 'page_arguments'.
It is as follows:
$items['car/%'] = array(
'title' => 'Cars',
'page callback' => 'car_page',
'page arguments' => array(1),
'access callback' => TRUE,
'type' => MENU_CALLBACK,
);
I want to attach the comment form (of the Comment Module) to that page.
I used the following code:
module_load_include('module', 'contact');
$build = array(
'header_text' => array(
'#type' => 'markup',
'#markup' => 'Building comments in page.',
),
'the_form' => drupal_get_form('comment_form', ''),
);
return $build;
All is correct code.
But the problem is that the comment form and the posted comments are loaded depending on the node Id (nid), and in my case there is no node Id (nid)!
How could i assign a specific identifier of that custom page so that the comment form functions correctly and comments related to that page are correctly loaded?!