I am writing a new module called mynode.module for learning the drupal system. The trouble is that I cant get the http://mysite.com/?q=mynode to get to generate what I want. I get a "Page Not Found".
My mynode_menu is as follows:
/**
* Implementation of hook_menu().
*/
function mynode_menu($may_cache) {
$items = array();
if ($may_cache) {
$items[] = array('path' => 'node/add/mynode', 'title' => t('New node type'),
'access' => mynode_access('create', NULL));
$items[] = array('path' => 'mynode', 'title' => t('New node type entries'),
'callback' => 'mynode_page',
'access' => TRUE, /* Allow access for anybody */
'type' => MENU_CALLBACK);
}
return $items;
}
I have coded mynode_page similar to blog_page_last() in the blog.module(basically, it generates last few posts of 'mynode' type). Still when I go to http://mysite.com/?q=mynode to get to generate what I want. I get a "Page Not Found" error.
What could be the reason that ?q=mynode is not recognized? Am I doing anything wrong in the hook_menu? How can I debug this?
Little bit background into what I did:
I started from page.module & changed it for mynode.module. In the process i created mynode_form, mynode_validate, mynode_insert, mynode_load, mynode_view as per documentation at 4.6 node_example.module