By nkulmati on
Hello!
For my module, I want to create a simple page, additional to settings and help ones that I have made using the instructions in that module tutorial.
So, I create a menu item for that in hook_menu:
$items[] = array(
'path' => 'admin/settings/extrapage',
'title' => t('Do extra stuff about the module '),
'callback' => ???,
'access' => user_access('administer storelocator'),
'type' => MENU_NORMAL_ITEM,
);
What is that "callback" setting ? I want this page to be just another node (of page type), with title same as 'title', and I want its content to be coded in my ".module" file, so it applies to any drupal installation and creates that addititonal page.
How would you guys do that ??
Thanks a lot !
Comments
hi,
- You have to first look here http://api.drupal.org/api/5/function/hook_menu . there is a link to an example there too.
- the "page type" node is already coded in drupal. You wouldnt have any benefit of creating a new one. But, in general, if you wanted to create a new type, it needs some more
work.
In you example above, you are kind of saying "if users goes to www.mydomain.com/admin/settings/extrapage , I want to show something. Most of the times you have to write yourself the "thing" you want to show to the user. If you do 'callback' =>'my_extra_page', then 'my_extra_page' must be a function which output the result you want to show to the user.
hth