b2evolution b2evolution

  • Sign in
  • Sign up
  • About
  • Downloads
  • Hosting
  • Docs
  • Support
  • Sign in
  • Sign up
  • Manuals Home
  • Latest Updates
 
  1. b2evolution CMS User Manual
  2. User's Guide
  3. How To...
  4. How to Display content as Tabs on a page

How to Display content as Tabs on a page

Goal

Display several Posts/Items as Tabs that can be switched instantly (if Javascript is enabled) like this:

How to Display content as Tabs on a page

Particularities:

  • All content is loaded at once but only one tab is visible at a time
  • If Javascript is enables, the switching requires no HTTP request (but the URL is still updated)
  • If Javascript is disabled; the switching will reload the page
  • The active tab is specified in the URL through a param like ?tab=slug-of-active-item

How to create such a Tabbed zone from scratch

The Tabbed Items Widget can be inserted in any Widget Container but for perfect & seamless handling of switching params, you should use a Widget Page. This is what we will do here…

1. Create a Widget Container in a Widget Page

If you don’t have a Widget Page with a Page Container yet, the quickest way to create one is this:

How to Display content as Tabs on a page

Make sur to create the new container for a new Widget Page :

How to Display content as Tabs on a page

This will create a new Widget Page and also a new Page Container inside that Widget Page.

2. Edit the Widget Page

Now, go edit the Widget Page by clicking here:

How to Display content as Tabs on a page

Then edit the following info:

  1. The title you want for the page
  2. The slug you want for the page
  3. IMPORTANT: The param name you want to use in the URL for switching tabs. By default you can use tab.
    • Note: If you are going to use multiple Tabbed Items Widgets on the same page, you can enter multiple params like toptab,middletab,bottomtab
  4. Publish the page…
How to Display content as Tabs on a page

If you later want to set this page as Front Page instead of a normal page, make a note of the Page ID / Item ID.

3. Add a "Tabbed Items" widget

Once you have published the page, you can use the Front Office Customizer mode to easily add a widget:

How to Display content as Tabs on a page

Various widgets allow you to list your content Posts/Items in various ways. The one we’re interested here is the Tabbed Items Widget.

4. Configure the widget

The key parameters to change here are:

  1. The param name to use in URLs to designate the active tab, for example tab which will result in ?tab=item-slug.
    • This must match a param name you have specified in the Widget Page in Step 2 (mark 3);
    • If you have multiple switchers on the same page, make sure to use different param names for each.
  2. The format for your tabs, in this case "Tabs"
  3. You probably want some sort of filtering or you will have 1 tab for every single one of your Items. In this example we filter on Post Type.
  4. When you apply the changes you will see the result of your settings (exit Customizer mode to test the switching)
  5. Note that you can go edit the templates in order to control how the tabs are formatted.
How to Display content as Tabs on a page

5. Optional: Set the page as front page

If you want to use that widget page as your front-page, you can set it here:

How to Display content as Tabs on a page
Created by fplanque • Last edit by fplanque on 2020-09-04 22:36 • •

No feedback yet

On this page

  • Goal
  • Particularities:
  • How to create such a Tabbed zone from scratch
  • 1. Create a Widget Container in a Widget Page
  • 2. Edit the Widget Page
  • 3. Add a "Tabbed Items" widget
  • 4. Configure the widget
  • 5. Optional: Set the page as front page

Search the Manual

Content Hierarchy

  • b2evolution CMS User Manual
  • User's Guide
    • Overview of the Software
    • Guided Tour
    • Features
    • FAQ (General)
    • What's New?
    • Important Concepts
    • Getting Help
    • How To...
      • How to add a New Blog
      • Customizing your blog
      • Adding content
      • Editing your User Profile
      • Managing Forums
      • Managing Online Manuals
      • Working with Multiple Collections
      • Managing Photo/Media Collections
      • Access the File Root of another User
      • Display content as Tabs
    • FAQ (Using b2evolution)
  • Installation / Upgrade
  • Front-office Reference
  • Back-office Reference
  • Developer Reference
  • Operations Reference
  • Advanced Topics
  • Glossary
  • Archives
CMS software

This online manual is powered by b2evolution CMS – A complete engine for your website.

About b2evolution

  • What is it?
  • Features
  • Getting Started
  • Screenshots
  • Online demo
  • Testimonials
  • Design philosophy
  • Free & open source
  • Terms of service

Downloads

  • Latest releases
  • Skins
  • Plugins
  • Language packs

About us

  • About us
  • Contact

Webhosting Guide

  • Web hosting blog
  • Best web hosting
  • Cheap web hosting
  • Green web hosting
  • Hosting with SSH
  • VPS hosting
  • Dedicated servers
  • Reseller hosting
  • Int'l: UK / France

Docs & Support

  • Online manual
  • Forums
  • Hire a pro !

Other

  • Adsense
  • Press room
  • Privacy policy

Stay in touch

  • GitHub
  • Twitter
  • Facebook
  • LinkedIn
  • News blog
  • RSS feed
  • Atom feed

Founded & Maintained by François Planque