English 中文(简体)
Drupal menu ,plica node content
原标题:Drupal menu , duplicate node content

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

没有任何办法阻止这种情况发生。

问题回答

我恳请你在你的模块中添加新的菜单,以压倒这条道路。 应该这样:

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;
}

之后,您将必须写上<代码>my_custom_questback<>/code>,履行本页的代码。

function my_custom_callback($nid = null) {
    // do your code
    return $output
}




相关问题
Drupal Multi-language: Simple strings not translated

I m adding additional languages to a Drupal site that I m building. Getting the translation of content working is fairly easy using the Internationalisation module. Yet, simple things such as date ...

Setting up a WYSIWYG editor for Drupal site users [closed]

Looking through the Drupal contrib modules, and after a few Google searches, it becomes evident that there are any number of choices and combos available to set up a WYSIWYG editor in Drupal. I m ...

Change size of user/password login box

I don t know how to change the size of the login username/password boxes on the drupal site that I m trying to build. I m stumbling through the theming, and don t know where to find the file that ...

How does Drupal provide an edit/review/publish model?

How does Drupal support a means to update and review a website before it is published? Does it only allow you to preview a page at a time before you publish it or is there a way to create a site ...

Term for rotating header

I m looking for terminology that describes this behavior: The header of a web-page contains a different image every time you visit it. Update: It is not an advertisement, but images related to the ...

Has anyone checked out Drupal 7? [closed]

Has anyone checked out a copy of Drupal 7 yet? What do people think? I m pretty excited about the PDO and all of the designers I work with a very excited about the new admin interface/structure. Do ...

热门标签