Dynamic Bootstrap Tabs for SharePoint
The following tutorial provides you with few simple steps to implement dynamic Bootstrap tabs on SharePoint 2013 sites based on web part zones, also called tabbed web parts.
In order to implement automatic tabs on SharePoint public facing sites using Bootstrap we need to reference Bootstrap files. To make things easier for this tutorial, we will use our ShareBoot theme for SharePoint 2013, which you can download here. We successfully tested this solution on all our Bootstrap-based SharePoint themes.
Step 1
So, first, download TopSPTabs.zip unzip it and upload the TopSPTabs,js to your theme folder. Go to Site Settings >> Master pages and page layouts >> Open your theme folder, which for the purpose of this tutorial is ShareBoot. Open the folder called “js” and upload TopSPTabs.js. Make sure to publish the file after uploading it.
Step 2
Next, go to the page you want to add the tabs and edit the page. In edit mode, click on “Add a Web Part” and from the web part pane select “Media and Content” then “Content Editor” and hit Add button. Once the new web part has been added to the page, click on the Web Part menu and from the drop-down menu select “Edit Web Part”. (Another way to edit a web part is by using the ribbon. With the web part selected, in the ribbon click on Web Part tab and select “Web Part Properties”)
Step 3
On the web part properties modal window, add the path to the TopSPTabs.js in the Content Link text box. The link should look something like this: /_catalogs/masterpage/ShareBoot/js/TopSPTabs.js
Give your tab group a name, select “Title Only” as the Chrome Type and hit OK button.
Now that you referenced the TopSPTabs.js whatever web parts you might add to the page will be part of the tab group.
Step 4
Go ahead and add few web parts by clicking on “Add a Web Part” and from the web part pane select “Media and Content” then “Content Editor” and hit Add button. (You can add any web parts available in the web part pane; “Content Editor”, “Script Editor”, “Content Query”, “Summary Links”, “XML Viewer”…)
Step 5
Make sure you name your web part added the way you want to show up in the tab, next select “Title Only” as the Chrome Type and hit OK button.
Step 6
Publish your page and you’re done.
If you don’t want to use the ShareBoot theme or any of our Bootstrap-based themes, we prepared for you a separate JavaScript file that references the Bootstrap files via CDN. Download TopSPTabsNoBS.zip unzip it and upload the TopSPTabsNoBS.js to your server. Follow Step 2 thru 6.
The easiest way to add dynamic and responsive Bootstrap tabbed web parts for SharePoint public facing sites.
I have been tasked with moving our SharePoint 2013 site to using Bootstrap. We had been using Spell Tabs for several pages that require a tab bar. Unfortunately, Spell does not work with a Bootstrap layout. I downloaded your TopSPTabs.js and although it does work with my Bootstrap page it takes ALL the web parts on the page and not just the ones in the same Web Part Zone. This is not the effect we want. Is there a way to restrict your tab script to only use the web parts in the same zone as the Content Editor WP that references the script. Spell allowed multiple tab bars on the same page which is something else we require.
Did you ever get tabs to work within just the zone its in? Any help would be appreciated.
I am also still trying to figure out how to possibly get this to apply to only the Web Parts in the zone that it is placed in. Also would like for it to not pull all of the Web Parts on the page (including those with chrome type set to None) into the tabs when in Edit mode.
You can call TopSPTabs([“WebPart Title 1”, “WebPartTitle 2″])
It will then only place the web parts with the specified titles into this element
I also added this so that it would show the first tab
$(‘.nav-tabs a[href=”#Tab0”]’).tab(‘show’);
Fantastic, thank you Luis. Brilliant instructions and worked first time.
How can restrict tabs and hide tabs that user does not have access to view that list?
Hi There,
Am plugging it in Sharepoint Online but nothing displays on the screen!
Any ideas
I have sorted this now, thanks.
How to go to a specific tab from another page or link? Currently it opens the First tab by default.
I am using the above solution for showing tabs in SharePoint and need to find a way to point to specific tab from another location or page.