I'm creating a new module, and so far everything has been going pretty well. I'm stuck on creating a new page, using MENU_SUGGESTED_ITEM though. I keep getting a page not found.

Here is my code for my menu item:

$items[] = array('path' => 'newsletter_archive', 'title' => t('Newsletter Archive'),
      'callback' => 'campaignmonitor_newsletter_archive',
      'access' => user_access('access archive'),
      'type' => MENU_SUGGESTED_ITEM);

Here is my code for the callback page function:

function campaignmonitor_newsletter_archive(){
  	$url = variable_get('campaignmonitor_PastCampaignURL','');
	if($url == ''){
		$content = '<p>The past campaign URL has not been set. Please set this in the administration pages.</p>';
	} else{
  		$content = '<script type="text/javascript" src="'.variable_get('campaignmonitor_PastCampaignURL','').'"></script>';
	}
  	return $content;
  }

Thanks for the help,

Steph

Comments

ssherriff’s picture

Nevermind, I figured it out. There really wasn't anything wrong except for it seems I had to have the functions that I call, before the function that calls them in the php file. For some reason I don't think I've had that problem before. Is this a php thing? Or just a drupal thing? Guess I've been spending too much time in the Java world.