Question

In drupal 6 the node menu is $items['node/%node']. This should give a url like www.sitename.com/node/1 but when accessing www.sitename.com/node/1/something again the same menu is called, thus making the contents of www.sitename.com/node/1/something as duplicate of www.sitename.com/node/1

is there any way to stop this happen

No correct solution

OTHER TIPS

I suppose you should add new menu path in hook_menu in your module which will override this path. Should be something like:

function mymodule_menu() {
    $items = array();
    $items['node/%node/something'] => array(
        'title' => 'My title',
        'page callback' => 'my_custom_callback',
        'page arguments' => array(1),
        'access arguments' => array('access content'),
        'type' => MENU_LOCAL_TASK // use this if you want to add new tab
        'type' => MENU_CALLBACK // use this if you want just callback function
    );
    return $items;
}

After that you will have to write function my_custom_callback which will perform your code for this page.

function my_custom_callback($nid = null) {
    // do your code
    return $output
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top