This guide provides a simple recipe for getting views menu tabs working on your site. What are views menu tabs?
Views menu tabs provide a handy way of separating content in the same view. They can simplify navigation by reducing scrolling on pages with lots of content or when using access controls, can hide content from unauthorized users. While views menu tabs can be very useful, they just aren't very intuitive to set up.
Views menu tabs are links to views page displays in the same view. Each tab has a different path with the last component being unique. One of these page displays must be the default menu tab and it will also be displayed at the path without the last component. The others are just menu tabs.
Let's look at how to set up the above example.
In this case, the menu tabs select views displays with different fields from the same node. The image field is used in both the View and Features displays but uses a different image style. Everything that needs to be set to achieve this is in the view display's Page Settings under Path and Menu.
You must use paths for tabs that only differ in the last component. For example, 'view' versus 'features'. The Default menu tab has a Parent menu item which in this case is Normal menu item. That's it.
Since the path, product/%/view, is the default menu tab, it will show the same content as the path, product/%.
This method does reload the page when switching tabs. If you want to avoid that or want to provide tabs for blocks, take a look at the Quick Tabs module.
Other uses for views menu tabs:
- User profile with tabs for curriculum vitae and awards
- Admin tab for draggable views when used with access controls for page display