Hello,

I am new to drupal and am trying access a custom module from the book pro drupal development.

The module showed up in the list and I enabled it but it doesn't seem to be being called

<?php
// $Id$

/**
 * @file
 * Use this module to learn about Drupal's menu system
 */
 
 /**
  * Implementation of hook_menu().
  */
  
 function menufun_menu() {
   $items['menufun'] = array(
   'title' => 'Greeting',
   'page callback' => 'menufun_hello',
   'access callback' => TRUE,
   'type' => MENU_CALLBACK,
   );
  return $items;
  
  
 }
  
/**
 * Page Callback.
 */
 
 function menufun_hello(){
  return t('Hello!');
 
 }

However when I go to www.myurl.com/menufun it does not call this function. Is there something I might need to enable that I am missing?

[Edited to add <code> and </code> tags; nevets]

Comments

nevets’s picture

What hapends when you visit www.myurl.com/menufun?

tflanagan’s picture

It just displays the page. It does not print out 'Hello!' like the book example shows.

nevets’s picture

What is the content area? Any error messages? Are you using a theme that come with Drupal core?

tflanagan’s picture

The content area is blank. No error messages. I am using Garland for a theme

jdevries’s picture

When you edit $items in hook_menu(), you always need to empty the cache for changes to take effect. This is because the menu system is cached. You can use the devel module module or you can empty the cache by clicking the "clear chached data" at the admin/settings/performance page.

Hope that helps.

tflanagan’s picture

Ok I did that. It now works if I do www.myurl.com/menufun/any character
Any ideas why it would need that tail?