http-redirectdrupaldrupal-6drupal-webformhook-menu

Drupal 6: How can i add a link to a hook_menu()?


I have my own module and I implemented a hook_menu, I want that one menu-item redirect (The menu has to stay active) to an existing webform page, this page is: ?q=node/add/webform.

$items['adminQuestion/create'] = array(
      'title' => t('Crear Cuestionarios'),
      'page callback' => "What i put here?",
      'page arguments' => array('form_questionnaires'),
      'access arguments' => array('access questionnaires'),
      'type' => MENU_NORMAL_ITEM,
  );

Solution

  • Here is the answer:

    $items['adminquestion/create'] = array(
      'title' => 'Crear Cuestionarios',
      'page callback' => 'questionnaires_page',
      'access callback' => TRUE,
      'type' => MENU_NORMAL_ITEM,
    );
    
    
    function questionnaires_page() {
        module_load_include('inc', 'node', 'node.pages');
        $output = node_add('webform');
        return $output;
    }
    

    where webform is an alias of node/add/webform. Thanks