Tuesday, February 22, 2011

Drupal Page Callback

If you want a link to direct for a page, do it with that menu callback hook function. You access the page without no menu navigation link.


 * Implements hook_menu()
function luna_menu(){

    $items = array();
    $items['luna/main'] = array(
        'title' => 'Main Menu',
        'page callback' => 'description',
        'access callback' => TRUE,
    $items['luna/po/%'] = array(       
        'page callback' => 'four',
        'page arguments' => array(2), // start from 0/1/2/3/etc
        'type' => MENU_CALLBACK,      // no link in nav menu
        'access arguments' => array('access arguments page'),
    return $items;

function description(){
    return 'Get the other for this one: <a href="po/4">About Us</a>';

function four(){
    return 'Hello. We are currently active in the what we do for the next year. We build a custom enterprise software for oil company.';

No comments:

Post a Comment