[support] help for my new node-type

Jason Flatt drupal at oadae.net
Tue Feb 21 15:42:38 UTC 2006


On Tuesday 21 February 2006 06:35 am, michel ziobudda morelli wrote:
> 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',

See if
      'path' => 'zbnews',
works.

>      '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.

-- 
Jason Flatt
http://www.oadae.net/
Father of Six:  http://www.flattfamily.com/ (Joseph, 13; Cramer, 11; Travis, 
9; Angela; Harry, 5; and William, 12:04 am, 12-29-2005)
Linux User:     http://www.sourcemage.org/
Drupal Fanatic: http://drupal.org/


More information about the support mailing list