How to Add Tabs to Drupal pages

Dev

How to Add Tabs to Drupal pages

by Spencer Amaral
//

BEWARE: INCREDIBLY SIMPLE

These steps work for:

Drupal 6

Drupal 7

The Need

We had a client request come in that required for us to add a new tab to the user profile for a new page.

The Problem

How in the world of Drupal are you supposed to add a tab? Use hook_menu_alter? No. Custom Module? No. Add it to a menu somewhere? No. (I mean, if you feel like spending more time than necessary you could do the first perhaps.)

The Solution

VIEWS! I told you it would be incredibly simple.

Step 1:

Create your new view.

Step 2:

Add a display: Page

Step 3: (Important Step)

Under “Page Settings” for “Path” you will need to set the path for the page under the parent page.

For Example:

If you want to add a Tab to all of the User profiles on your website, set your path as “user/%/yourtab”. (% will become the uid of the profile being viewed)

 Step 4:

  Also under “Page Settings” is “Menu”, set this to “Menu Tab” or “Default Menu Tab”. From there you will set your Tab’s title, description and it’s parent item.

Step Done:

  That’s it, you’re finished! Now you may run free and set up your one of a kind, mastermind view!

In Picture Book Format

 

Simple indeed, but so useful!

More About the Author

Spencer Amaral

Web Developer
How to Add Tabs to Drupal pages BEWARE: INCREDIBLY SIMPLE These steps work for: Drupal 6 Drupal 7 The Need We had a client request come in that required for us to add ...

See more from this author →

InterWorks uses cookies to allow us to better understand how the site is used. By continuing to use this site, you consent to this policy. Review Policy OK

×

Interworks GmbH
Ratinger Straße 9
40213 Düsseldorf
Germany
Geschäftsführer: Mel Stephenson

Kontaktaufnahme: markus@interworks.eu
Telefon: +49 (0)211 5408 5301

Amtsgericht Düsseldorf HRB 79752
UstldNr: DE 313 353 072

×

Love our blog? You should see our emails. Sign up for our newsletter!