2

I would like to have a tab appear in the view of a node, like the "View, Edit, and in the example shown) the Group Tab. Any ideas? I'm guessing it is going to have to write some custom code.

(see attachement) enter image description here

0

For creating tab in views you have to go to the menu option in your views and select menu tab option then create your menu that will reflect as tab. If you are not clear enough. Then let me know the exact requirement, like where do you want to create tab, on landing page after login or on custom view page.

You can do this without custom code as i have done same thing many times.

| improve this answer | |
1

Drupal by default displays the tab to the users who have the permission to access the particular section. For example, you can see these tabs when you are logged in as administrator (user1) of the site. If any other role has the permission to edit the node, then the edit tab will be displayed to the user having that role, by default.

EDIT: Extra tabs may get added by adding contributed modules to the site (also depends on the permission to the users to access it). See the screenshot, it adds an extra tab Devel to the node type page. It is because I downloaded and enabled the Devel module. snapshot

| improve this answer | |
0

in your module you can add menu with its function callback

$items['user/%user/group'] = array(
    'title' => 'Group',
    'type' => MENU_LOCAL_TASK,
    'page callback' => 'user_group_page',
    'access callback' => TRUE,
  );

this should be in yourmodule_menu() hook function. user_group_page() will return content for this tab you should define it in your code

| improve this answer | |
0

If you are talking about default tab for any node you created then add a line to your page.tpl.php.

<?php if ($tabs): ?>
              <div class="tabs">
                <?php print render($tabs); ?>
              </div>
           <?php endif; ?>}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.