views:

264

answers:

4

Hi,

I want to add a tab to Drupal node like in the following picture:

alt text

The picture has 3 tabs, Views, CVS Instructions, Revisions. I want to add another tab "Translation". What module should I use?

The picture was taken from http://drupal.org/project/panels_tabs

Thank you.

+1  A: 

I would create a simple small module that has a hook_menu implementing the tab.

See the example here:

http://drupal.org/node/678984

As for the rest of your implementation, I don't know what you are trying to achieve, but this will add tabs.

Kevin
I'm trying to add a tab which links to another node, that node will be shows in the the tab. So I can have one node in the English and another in other language in the same page.
Narazana
I see. Well this will get you the tab.
Kevin
A: 

Not sure if this is relevant but if you are actually looking to translate node content then have you investigated the Internationalization module?

monkeyninja
A: 

The translation tab is handled by the module "Content translation" that depends from "Locale"; once you enabled the module, you need also to set which content types can be translated, and other settings that change the way a node of that content type is translated.

kiamlaluno
A: 

Not quite what was asked, but here is code for hook_menu in a custom module that sets up an administration menu option with 2 tabs.

/***************************************************************
*  hook menu
*/
function acme_viewer_setup_menu(){
  $items = array();

  // administration setting - call from URL
  $items['admin/settings/acme_viewer_setup'] = array(
    'title' => 'Acme Misc Setup - viewer and Blog',        // title in Admin menu
    'description' => 'Acme Misc Setup: acme viewer & Blog',
    'page callback' => 'drupal_get_form',                        //  Retrieves form 'acme_viewer_setup_admin'
    'page arguments' => array('acme_viewer_setup_admin'),
    'access arguments' => array('access administration pages'),  // only users who can access admin pages
    'type' => MENU_NORMAL_ITEM,
   );

  // tab 1 - viewer
  $items['admin/settings/acme_viewer_setup/viewer'] = array(
    'title' => 'Configure viewer',                 // title in tab
    'page callback' => 'drupal_get_form',              
    'page arguments' => array('acme_viewer_setup_admin'),
    'access callback' => 'user_access',
    'access arguments' => array('access administration pages'),
    'type' => MENU_LOCAL_TASK,
  );

  // tab 2 - blog
  $items['admin/settings/acme_viewer_setup/blog'] = array(
    'title' => 'Configure Blog',   // title in tab
    'page callback' => 'drupal_get_form',
    'page arguments' => array('blog_setup_admin'),  
    'access callback' => 'user_access',
    'access arguments' => array('access administration pages'),
    'type' => MENU_LOCAL_TASK,  
  );


  return $items;
}
ernie

related questions