[support] help for my new node-type

michel ziobudda morelli michel at ziobudda.net
Tue Feb 21 14:35:35 UTC 2006


Hi. I have created a new node call "zbnews" that derive from story node.
I can insert, see, and update my node. Now I want to create a way to
redirect the user to an external page if he clicks onto my link
zbnews/goto/{node->nid}

I have this code:

function zbnews_menu($may_cache) {
  $items = array();

  if ($may_cache) {
    $items[] = array('path' => 'node/add/zbnews', 'title' => t('Aggiungi
una notizia'),
      'access' => user_access('create zbnews'));
    $items[] = array(
      'path' => 'zbnews/goto',
     'title' => t('Page redirect'),
      'callback' => 'zbnews_goto',
      'type' => MENU_CALLBACK,
      'callback arguments' => arg(2),
      'access' => user_access('access zbnews'));
  }

  return $items;
}

 function zbnews_goto($lid = NULL, $url = NULL)
{
 header("Location: http://www.mysite.com");
}

But when I click,eg,  <a href="?q=zbnews/goto/5">Link nr.5</a>, Drupal
return me page not found.

Where is my error ?

Tnx.
-- 
Michel 'ZioBudda' Morelli                       michel at ziobudda.net
http://www.ziobudda.net                         ICQ: 58351764
http://www.phpbook.it                           FAX: 0291390660
						TEL: 3939890025


More information about the support mailing list