SharePoint pages: add tabs in a snap!

EasyTabsWebPart

I have just released the “Easy Tabs Web Part” for SharePoint 2007. Check out the demo, the video and the Web Part for download on my SharePoint site:

http://www.pathtosharepoint.com/pages/easyTabs.aspx

The Web Part can be used on a SharePoint 2007 site by anybody who has design or full control permissions (it is actually based on a Content Editor Web Part). The installation does not require server access.

Update [5/24/2009] In addition to the swf format on my SharePoint site, the screencast is now available on YouTube. Duration:1min25.

Update [5/26/2009] Thanks all for the great feedback (comments and e-mails)!

I have added a twin Web Part to the download section, for those who want another set of tabs for another Web Part zone on the same page.

I am also going to add two sections on the site, one for FAQ and another to track known issues.

Update [5/29/2009] Version 2 now includes cookies. Reloaded pages will remember the active tab. This is useful for example when you switch between different views of a calendar (Mark’s comment), or if you use sorting/filtering options on list columns.

Advertisements

203 thoughts on “SharePoint pages: add tabs in a snap!

  1. Hey Christophe,

    I just found your blog earlier this week and man, you seriously ROCK! No doubt you’ll get MVP-hood soon, and it’ll be well-deserved. You’re doing an outstanding job at making Sharepoint more accessible. Please keep it up….

    Do consider turning on some sort of archive navigation feature though, to improve access into your earlier blogs. 🙂

    Regards,
    Renee

  2. Hi Christophe

    Excellent. A couple of comments that would improve this.

    If I wanted to add more data to each page then all it will do is create another tab.

    What about if I want 2 or three web parts on the same page?

    A combination of this plus what Peter Allen did on Bit of Sharepoint would be killer.

    Keep up the great work.

    Iain

  3. Hi Christophe

    Just to letr you know, I added in your easytabs in conjunction with Peter Allens’ Tabs and it works very nicely.

    Iain

  4. Hi Christophe

    With the exception of what I mention the other day – it does not like 2 or more jquery expressions looking up other site lists.

    Iain

  5. Thanks Renee 🙂

    There’s a categories navigation on the left side of the blog, for my main topics (menus, jQuery, etc.).
    What I am actually trying to do – and this post is an example – is push my how-to articles to my SharePoint site, where I can easierly organize content by topic and have cross-references. I am keeping the blog for announcements, one-time topics, and of course… readers’ comments!

  6. Thanks for the comments Iain.

    There are many variations around my solution. My design choice was to offer a no brainer. Add it to your page, and immediately it works. Remove it, and your page is back to its initial state.

    I have sent you an e-mail about your issue.

  7. Christophe, You have built an awesome webpart – it works fine on my site. By the way, how can I change the colors of the tabs? They do NOT change if I change the theme of the site while in Excel web access web-part the colors of toolbar are changing.
    Does it have something to do with some missing style sheets or anything else? They just remain standard blue colored.
    I could not find these classes in any other page, could You name the CSS file which contains the color definitions for the tabs?

  8. Christophe, thank you very much for sharing this great work!

    The problem I have is that if I put the tabs in a webpart zone I can not put more webparts in the same webpart zone or up or down

    Any solution?

    Thanks again!

  9. Christophe – this looks very interesting! I am amazed at the creativity of some. I have followed your instructions to implement tabs but I am not getting the result I expect.

    When in site settings – exit mode I can see the tabs with the names of my web parts. However, when I exit edit mode I do not see the tabs..my web parts are the same as they were before I attempted to install the Tabs??

    I am sure I missed something here but it is not coming to me yet. Any ideas?

    Thank you.

    • Jim,

      I had the same problem and it was because I had a custom web part in the zone that didn’t have any body (it was somewhat of a datasource web part that didn’t display any data).

      Since the web part didn’t have a title, the Easy Tabs js was failing to insert the part.

      To solve the problem I just moved the custom web part to a different zone and everything started working.

      Hope this helps.

      Tom

  10. Nie tool…
    the easy tab for web part works fine in ‘web part pages’ .. but you try to used in the default.aspx… come with a Yellow Triangle in exclamation.

    The message details is:
    Line: 1749
    Char:1
    Errorr: ‘ document.getElementByld(…)’ is null or not an object
    code: 0
    URL: http://www.abc.com/services/……/default.aspx

  11. Pingback: Christophe’s Easy Tabs at Path to SharePoint « Marc D Anderson’s Blog

  12. Christophe,

    Beautiful solution. This is a great and easy way to add tabs quickly. I will be adding this to my list of solutions.

    Keep up the great work.

  13. Jesus: same reply as for Iain. I kept it simple, ease of use was my design choice.
    I have already received a lot of feedback in the past 48 hours, and I plan to propose some variations around this initial version. You’ll find them on my SharePoint site… under a new tab!

  14. if you add several ‘Key Performance Indicator List’ web parts do not brings the light indicators..

    • cris, I don’t see this issue on my examples. And honestly I don’t see why this would happen – the script is not making any change to the content, it just toggles the display.

  15. Hi Christophe,

    this is a really nice solution, simple but incredibly useful for those overcrowded web part pages.

    Just one question: I have a calendar web part with a calendar view that is not placed as the first web part in the web part zone. If i switch from month to week, the page reloads as always, but the active tabs defaults to the first web part. Is there a way to make the script remember the selected tab?

    Unfortunately, my programming skills don’t allow me to figure this out myself.

  16. Hi Christophe,
    Would it be possible to have multiple webparts under one tab?
    Also, did you consider an ‘undo’ button (to go back from the view with tabs back to the page with all webparts?)

    Terrific work as always!

  17. Hi Christophe.

    The Javascript works great as built. Could I propose something I would love to see as an enhancement:

    A way of nominating which wep parts in the current zone are to be rendered as tabs – This could be an “Inclusion array” or an “Exclusion Array” (the exclusion array would probably be shorter).

    You might have to use the Webpart titles (as the position might change). You may also need to position the tabs at the same level as the Easy tabs web part, so you could position the tabs say between other web parts (at the moment I think it runs at the top of the Zone).

  18. Hi Chris! I am a new fan of yours. I found your blogsite when I google on SharePoint Tips and Tricks. I am so very happy to implement all your easy to build SharePoint features. I hope to see more! I am trying to collate all your features in our own team site so others can make implement it in their own team sites. Thanks again.

  19. This is fantastic. It works well with WebParts in the gallery. Anyway of extending this to include data view web partswwhich pull data from other databases (not Lists)? Thanks and appreciate your sharing this. Best Regards, Sudhi

  20. I have set up a page with several tabs. I added a new tab but would like to move it so that it appears as the last tab, rather than the first. Any suggestions?

  21. Hi am getting the same error as shown on the post (May 21, 2009 at 4:14 pm cris)

    My error is on Lin 533 which is the following:

    {
    while(elem !=null && elem.tagName !=”TABLE”) elem=elem.parentNode;
    return elem;
    }

    Only get this error when adding a Content Editor web part which has a table created within it.

    Hope you can help! Think the tabs are great, would be the icing on the cake to get them working with the Content Editor Web Part

    Thanks in advance!

    • Ah…just found the problem – if you set the web parts to have Chrome=None then you get the fault, they must have at least Chrome=Title Only at the very least on all web parts within the section as the Easy Tabs webpart.

      Is it possible to amend the Easy Tabs webpart so that it works when the webparts are set to Chrome=None?

      Thanks!

      Heidi

      • Just noticed it ignores the Title anyway….ignore me, must be having that Monday feeling! 😀

        Great webpart 🙂

  22. Hi Christophe

    Thank you for taking the time to help me customize the appearance of Easy Tabs to match my corporate Intranet colors. Easy Tabs is a great solution for minimizing the clutter on our Intranet page.

    Your support was great, keep up the good work
    Andrew

    • Hi Andrew

      I’m trying to do the same thing. I wonder if you could elaborate a little on what you did.

      Thanks,
      Candice

  23. Hi, say i have 6 views labelled 1-6. I then add the Easy Tabs webpart. I add a second Easy Tabs(biz) webpart and i come out 2 consecutive rows of Tabs both showing the same 6 views on each. I was wondering if i could have 1-3 on the top row and 4-6 on the second row of the tabs?

    Thanks again for this great solution!

  24. Hi.

    Brilliant!

    I have a small niggle. I’m not getting a closing top border across the webpart. IE right below the tabs. Any idea?

  25. Hi Christophe,

    I am trying to edit the look and feel of the tabs, including the font style and color. I would appreciate any help you could give me.

    Thanks!

  26. The Tabs point to CSS in the Core.css file. The ones that I amended were ms-tabselected and ms-tabselected. For myself I have assigned another custom CSS file to my master pages. I copied the TAB CSS out of the core.css and pasted them into my custom css file.

    I then renamed them as per the examples below. All you then have do do is edit the tabs webpart to point at the new css names.

    .sth-tabselected{border-color:#DDDDDD;border-width:1px;border-style:solid;font-weight:bold;position:relative;top:0px;padding-top:7px;padding-bottom:7px;padding-left:10px;padding-right:10px;color:#194C80;background-repeat:repeat-x;background-color:#E8E8E8;margin-right:5px}

    .sth-tabinactive{position:relative;top:0px;padding-top:7px;padding-bottom:7px;padding-left:10px;padding-right:10px;color:#194C80;background-color:#F2F2F2;background-repeat:repeat-x;border:solid 1px #DDDDDD;margin-right:5px}

    • Tony,

      Thanks for the help! Can you tell me what you changed in the tabs webpart. I’ve made a few edits to the tabs webpart but it dosen’t seem to pick up the new css file I created.

  27. Christophe, it’s a great webpart again, Thanks very much

    I have created a SPGridView custom webpart which displays items from a Sharepoint Custom List

    I have one problem, when I try to add a SPGridView custom webpart in the same zone where the tab webpart exists, the custom webpart is being displayed in all the tabs instead of one particular, help me, Thanks for your efforts

  28. Christophe, this would be of immense value to me but for the fact that I am seeing exactly the same problem as Jim mentioned in the comments on 21st May at 3:40pm.

    Basically your code displays the Tabs correctly in Edit Mode – the page has a single Web Zone with the EasyTab Web Part and two List Web Parts – but the tabs disappear when Edit Mode is exited. I’ve checked in the Web Part Manager that there are no other Web Parts hanging around closed without a Title, as suggested by Tom Dietz in reply to Jim.

    Interestingly I have an identical problem with another ‘custom’ Web Part using jQuery, on another page, which is doing exactly the same thing – works perfectly in Edit Mode and ceases to function in normal mode!

    I’m wondering if there something wrong with the SharePoint Service itself rather than your code or the jQuery code.

    Has anyone else seen this problem and/or have any ideas what could be causing the problem and how it can be fixed?

    Regards,

    David

  29. Hi. Request!

    Is it possible that the first click selects and displays the tab and then if you click on the title again, it launches the webparts title url?

    No rush. Tomorrow is fine 😉

    I wonder if they’ll put something like this in 2010 OOTB? It really does transform Sharepoint.

    P.S

    Christophe we love you!

  30. Cool but I can only get it to work with OOTB webparts. Any of my custom webparts that use caml to query lists or sql based webparts don’t show in tabs. What should I do so it works with custom webparts? This would really rock for me if I could get it to work with my custom webparts…

    Thanks in advance!!!

  31. Strange mine work fine with Webparts pointing to lists and bdc data created with SPD. You are choosing title and border in the webpart options arn’t you? 😉

  32. Hi, Request

    Easy Tab works with only Main landing page is it right,cos i am trying to implement this with list ,or custom list,easy tabs does not work.

    In edit mode it is there,once out of edit mode,it is in hiddne mode.
    Any reason for this.

  33. Thank you Christophe. This is a very useful webpart. I have a page with a very long list of webparts and the tabs extend off the screen to the right. Is it possible to add some code that would wrap the tabs into two or three rows?

    I looked at your solution about splitting the top navigation in two but I couldn’t work out how to adapt and insert that code into this webpart.

    Can you propose a solution? Thanks.

  34. Christophe,
    I have used this webpart with great success on a team site but when I tried to use it on a blog site it did not work. Is this a limitation of the webpart?

  35. I tried to use the easy tab one in the first left zone side and in the second left zone , and they do not work..

    I replaced “12345” with another number and still not working

    Does anybody is facing the same problem?

  36. Outstanding! The best thing is the page dows not reload – no more dead white page as you move between content.

    One question – I have added multiple views of a calendar, as well as a List view of the calendar.

    All is perfect except on the list view, which has a full toolbar, the ability to access other Views is not there. I want the enduser to be able to view the calendar views, but then have a tab where they can look at a wide variety of List views.

    The rest of the Full toolbar is shows (New, Actions, Settings)

    Any thoughts?

  37. Pingback: List/Libraries vs RSS for data feeds | End User SharePoint

  38. Thought I would share a slight addition to the EasyTabs. I needed the ability to have a hyperlink to the SP site that would automatically display the appropriate Tab. So I added a couple of lines to the Javascript to accomodate this.
    This script modification looks for the Anchor Tag Hash “#” in the url.
    If it exists then display that tabby setting the SetCookie function Christophe added.
    Here is the javascript code modified.
    ————————————

    /* Easy Tabs for Web Part pages – v 2.0
    Christophe Humbert
    Christophe@PathToSharePoint.com */

    var TabCookie = “TabCookie” + window.location.pathname;

    function GetParentTable(elem)
    {
    while(elem !=null && elem.tagName !=”TABLE”) elem=elem.parentNode;
    return elem;
    }

    function activateTab(selectedtab)
    {
    if (WPzone.id != “MSOZone”)
    {
    var allTabs = document.getElementById(“EasyTabs”).getElementsByTagName(“SPAN”);
    for (i=0;i<allTabs.length;i++)
    {
    var WPCellID = allTabs[i].id.replace(/tab/,"MSOZoneCell_");
    var TitleID = allTabs[i].id.replace(/tabWebPartWPQ/,"WebPartTitleWPQ");
    if (allTabs[i] == selectedtab)
    {
    allTabs[i].className = "ms-tabselected";
    document.getElementById(WPCellID).parentNode.style.display = "";
    document.getElementById(TitleID).parentNode.style.display = "none";
    }
    else
    {
    allTabs[i].className = "ms-tabinactive";
    document.getElementById(WPCellID).parentNode.style.display = "none";
    }
    }
    }
    }

    function BuildEasyTabs()
    {

    var TabsTD = document.createElement("TD");
    TabsTD.className = "ms-siteactionsmenu";
    TabsTD.id = "EasyTabs";

    var SeparatorTD = document.createElement("TD");
    SeparatorTD.style.height = "5px";
    SeparatorTD.className = "ms-pagetitleareaframe";

    var theDIVs = WPzone.getElementsByTagName("DIV");
    for (i=0;i’-1′)
    {
    var urlAnchor = pageUrl.substr(pageUrl.indexOf(‘#’)+1, pageUrl.length).replace(/%20/gi, ” “);
    if (urlAnchor.indexOf(‘?’)>’-1′){urlAnchor = pageUrl.substr(pageUrl.indexOf(‘#’)+1, urlAnchor.indexOf(‘?’));}
    }
    //End Section added by B.J. Davis

    Easy Tabs for Web Part pages – v 2.0
    Christophe Humbert
    Christophe@PathToSharePoint.com
    – This WebPart should be set to Hidden.
    – Select Modify Webpart.
    – Layout
    – Make sure there is a checkmark the Hidden Checkbox.

    ————————————

    • Well it appears that the webpage stripped out some of the code.
      I will try to again.
      At the Top or Bottom of the Script i added.

      pageUrl = location.href;
      if (pageUrl.indexOf(‘#’)>’-1′)
      {
      var urlAnchor = pageUrl.substr(pageUrl.indexOf(‘#’)+1, pageUrl.length).replace(/%20/gi, ” “);
      if (urlAnchor.indexOf(‘?’)>’-1′){urlAnchor = pageUrl.substr(pageUrl.indexOf(‘#’)+1, urlAnchor.indexOf(‘?’));}
      }

      in the Function BuildEasyTabs i added the following after the line TabsTD.appendChild(NewSPAN);

      if ((NewSPAN.innerHTML==urlAnchor)||((urlAnchor==”) && (i=0))) {SetCookie(TabCookie,NewSPAN.id,”/”)}

      i hope this comes out correctly.

      • B.J., I am trying to create a hyperlink to a specific tab. I tried adding your Java Script to my Easy Tabs code, but no success. The tabs will not generate at all once I add in the code. I may not be putting it in the right place or leaving something out. Can you assist further?

      • Here is what part of my code looks like:

        NewSPAN.className = “ms-tabinactive”;
        NewSPAN.style.height = “18px”;
        NewSPAN.id = “tab” + theDIVs[i].id ;
        NewSPAN.onclick = function()
        {SetCookie(TabCookie,this.id,”/”);activateTab(this);}
        TabsTD.appendChild(NewSPAN);
        if ((NewSPAN.innerHTML==urlAnchor)||((urlAnchor==”) && (i=0))) {SetCookie(TabCookie,NewSPAN.id,”/”)}
        }
        }

        WPzone.insertRow(0);
        WPzone.rows[0].appendChild(SeparatorTD);
        WPzone.insertRow(0);
        WPzone.rows[0].appendChild(TabsTD);

        Does this look correct? I wasn’t sure whether to add your line before or after the brackets but tried several ways.

        When I remove the new code (below) the tabs work fine
        if ((NewSPAN.innerHTML==urlAnchor)||((urlAnchor==”) && (i=0))) {SetCookie(TabCookie,NewSPAN.id,”/”)}

        Thanks for your help. The ability to set a link to a specific tab is very beneficial.

      • I also did as you wrote, and my tabs do not generate, as well. Can anyone help? I would like to have a specific tab show up from a hyperlink..

  39. I LOVE this but can’t use CQWP or Table of Contents Web parts with it- for some reason, these web part types “break” the Easy Tabs.

    I just get regular web parts broken out on the page whenever one of these is in the zone where I have the Easy Tabs.

    Has anyone else experienced this? Is there a fix?

  40. Hey Christophe,
    I am not sure if I missed something. I implemented this script. It built the tabs perfectly. After i add all the webparts I realized there were too many. I was trying to figure out how to get the second row. I added the easytabs a second time and updated the ID, b ut that just duplicated what I already had. what am I missing to get the one set of webparts to display in 2 rows?
    thanks

  41. Christophe, The best service made to me by Google was leading me to Paths…

    EasyTabs is working well for me, and am ready to expand my use, but I am becoming sensitive to features and version… I note that you have posted the new EasyTabs Customization Guide. In both the title of the guide, and on page 11, you reference EasyTabs “v3.” (“… The Easy Tabs won’t find the title and will ignore the Web Part (new in v3).”)

    The version of the two downloads are “2.0.” Will there be a “v3” coming?

    R’grds – Ben.
    P.S.: Have adopted most of your Calendar toolbox, folks think I am a hero, I think you are a hero!

    • Ben – v3 is not public, it is a version I developed for the participants in the endusersharepoint.com workshops. I’ll remove the guide to avoid any confusion.

  42. Christophe;

    Not that it hasn’t been said already, but this is a huge contribution so thank you! Like many of the posters I have a fairly urgent need to split the tabs for a single web part zone into two (or more) rows and I missed your session on EUSP. I tried to follow your post on splitting the tab bar but I’ve not worked it out successfully.

    If you don’t have another session scheduled on EUSP soon then is there any chance that you could elaborate here on the methods used to break the tabs into a specified number of rows? Thanks again!

    -Eric

  43. Hi Christophe,
    Thanks so much for an excellent webpart. I’m almost exclusively using data view web parts on my site collection. Is there any way to use the easy tabs with the data view web parts?

    As someone else similarly noted above, when the easy tabs web part is added to a web part zone, the tabs are visible in the edit mode, but not in use mode. I’m guessing this has something to do with the data view web parts.

    Thanks, Kelly

  44. Christophe,

    Once again, great work and well liked.

    Would it be possible to reinstate the EasyTabs Customization Guide. Understand V3 is restricted to EUSP; would like to userstand V2 and the options to modify that.

    Cheers,

    Chris

      • Thanks for your reply. It works if add a new webpart page and task views to it. But if I try to edit the default tasks aspx page(AllItems.aspx) and add views as webparts, it doesn’t work. Am I missing something.. Your help is really appreciated.

  45. As part of my additional styling elements for a custom CSS, I modifed a few of the tags below and it helped me craft an improved customized tab appearance to match my custom masterpage. However, I can’t figure out what is forcing the spacing between the tabs and the tab body. Any hints?

    >>> This puts a box around the web parts with a thin grey line
    ———————————————————————————
    .ms-WPBorder,.ms-WPBorderBorderOnly {
    border-width:1px;
    border-style:solid;
    border-color:#cccccc;
    padding:10px 12px 12px 12px;
    }
    .ms-WPBorder
    {
    border-top-width:0px;
    ———————————————————————————-

    >>> This formats the tabs
    ———————————————————————————-
    .ms-tabinactive
    {
    font-weight:normal;
    position:relative;
    top:0px;
    padding-top:3px;
    padding-bottom:3px;
    padding-left:10px;
    padding-right:10px;
    border-bottom:none;
    background-color:#cccccc;
    background-image:url(“>>insert your tab bg image here<<");
    border:solid 1px #cccccc;
    color:#666666;
    }
    .ms-tabinactive a:link
    {
    color: #666666;
    text-decoration:none;
    }
    .ms-tabinactive a:hover
    {
    color: #000000;
    text-decoration:none;
    }
    .ms-tabinactive a:visited
    {
    color:#666666;
    text-decoration:none;
    }
    ——————————————————————-

  46. @ramesh: the Easy Tabs will only work on the default (home) page and custom pages you create. The reason: on a list page, the Web Part titles are not displayed, so the Easy Tabs have nothing to build from.

    • Thanks for your quick reply. I added a custom page and made it look like real page by remove all placeholder tags. Really nice..
      Thanks much

  47. Hello Christophe, I figured out what I did wrong from my earlier post – I now have downloaded the EasyTabs WP and have it placed on a Calendar that has two CEWP’s. I’m experiencing the same issue as others have – I see the tabs in “Edit” – not in “View” and I have the “Appearance” chrome set at Title on each one. The appearance “Chrome” on the EasyTabs WP is also set at Title. I’ve also got the EasyTabs WP hidden. Did I miss something from the other’s posts? – also, the EasyTabs WP created a “New Default” view and that’s the one I’m working from.

    Thank you for your time and assistance.

  48. Christophe,

    Ok the easy tabs works great! Been following you for some time here and on the MSDN forums!

    My question is this… I have articles that are say given category names.
    Blogs : Arcade Games, Console Games, PC Games

    I want the Blogs to roll out to show the three above. Like here in this article you wrote:
    https://pathtosharepoint.wordpress.com/2009/01/15/a-drop-down-menu-the-sharepoint-way/

    And still have each WebPart containing the rollouts to have a TAB across the top.

    I know I know odd… but I thought it would be nifty for a clean organizational approach. E-mail me or Post here!

    Thanks again!

  49. I forgot my goal is that the drop down menu would be generated from a list of documents.

    Each tabbed area would have these documents that area separated by each field…

  50. Hey! Qucik question…. I noticed yoru rounded corners article as I was reading… could you round the corners of yoru tabs? Is that possible?

    • Kris: sure you can. For example it is built in v3 of the Easy Tabs which was given to the workshop participants.
      The jQuery corner plugin is easy to use, just apply it to the tab row.

  51. Sounds like I should get in on a workshop soon! Well one more question. I imported a webpart that is a summary link list that I created. When I add it to the webpart zone that contains the tabs the tabs do not work??? What gives?

  52. I tried to use this and it’s not working. I see the Easy Tabs web part and put it in but and I see the tabs when I’m in edit mode but nothing happens when I publish the page.

  53. I am new to the SharePoint world and hoping to get some guidance from you. I’ve downloaded the easytab webpart but when I added it using the Site Action>Edit Page> Add webpart. I can only see one tab. I can’t see the rest. Let me know what I missed. Thanks

  54. Great idea for simplifying navigation.

    I may be interested in attending one of your sessions, however I have a fairly immediate need to exclude web parts from the tabs. Can you provide me any info on how to go about this? Glancing over the existing java script nothing looks obvious.

    Thanks.

  55. I’d like to have 2 webparts in one tab. Has anyone been able to get easytabs to work this way ?

    Any help greatly appreciated

  56. Christophe:

    I love the EasyTabs webpart. It has solved a lot of problems, but I have one question. If I have the tabs set up and I have tabbed my DVWPs, I wuold like to filter another DVWP (not in the same WP Zone) based on which tab is selected.

    If I have a list that has items relevant to tabs 1, 2 and 3 and when I click tab 1, how can I filter that list that only has items relevant to tab1?

    I think another way to ask my question is how do I pass the selected tab name to the DVWP as a filter element?

    • There are various ways to do this. I’d suggest hat you take a look at JavaScript/jQuery solutions for dynamic filtering of tables.
      One thing to keep in mind is that clicking on a tab doesn’t refresh the page (that’s the purpose of the Easy Tabs). So solutions that involve querystrings or Web Part connections won’t work well here.

      • So when I look in the code, and I see the line ‘activatetab(ActiveTab), there is no way I can capture the value of ‘active tab’ and pass that to a filter on another DVWP?

        • The default SharePoint filters trigger a page refresh.

          If you’re not ok with the page refresh, then you’re correct, you cannot pass the filter. You need to build your own dynamic client side filter.
          If you’re ok with the page refresh, then there’s no reason to use the Easy Tabs.

      • We are using Easy Tabs on our site and clilcking on a tab does, indeed, cause a page refresh. The WebParts being “tabbed” are all Content Query WebParts but we do not want to refresh when clicking on the page.

        Do you know why this might be hapenning?

  57. This is a great web part – well done!

    is their anyway of deciding which webparts get tabbed in the same zone? For example you may want generic content editor webpart to show regardless of tab slected. Then you could choose say web part 2,3,4 to be included in the tab.

    any ideas Chris?

    thanks in advance for your hard work and for sharing it!!

  58. Hi Chris,

    Great work on the easy tabs, I have vistied your site over the past 2 years for ideas for a work site that I use. I have recently implemented your easy tabs for an excel dashboard I created.

    In this dashboard you are able to drill down by clicking on a project to view certian information. The only problem I have is you have to hit the back button to refresh the “Projects tab” in order to go back to the chart. Is there a quick code in Java (sorry not a programmer) when you click on a tab it goes back to the main webpart?

    Thanks in advance.

    Ross

    • Ross, it’s hard to tell without knowing how you built the drill-down effect.

      Instead of a page change, have you considered using a tooltip? Then the chart never disappears.

  59. Chris:

    Question – I see in some of the blog entries here, about the 2nd row of tabs to avoid the horizontal scroll that people had questions about that – I did not see any replies. Do you have some insight to how to get two rows of tabs (essentially a word-wrap of tabs)? This would be very helpful in some cases in my project.

    Thanks!

  60. Hi Christophe, excellent work on EasyTabs web part. One question, do you have inputs as how to specify or groups multiple webparts (i.e. Announcements) into a single tab? Thanks!!

    • The script is built to automatically generate one tab per Web Part – that’s what makes it easy. To do what you want, you’d need to specify manually which tab goes with which column. See for example bitsofsharepoint.com for such solutions.

  61. Hi,

    Really cool stuff! I had a question is it possible to have a forms on each of these tabs..and have a separate submit button for each forms.

    I am trying to create a bunch of forms where users presss Next..button for navigation.

  62. Great stuff dude. I was showing this to a peer tonight (Callahan) and she asked whether it worked, ready to roll in SharePoint 2010. So, we gave it a shot and alas, while there were no errors or pages freaking out, it also didn’t produce any tabs.

    I’m sure you are busy, but I’d love to see this continue to work in SP2010 and wanted to give you a heads up, before it is released (2010) to the public.

  63. Hello, Christophe

    First of all Congratulations for Easy Tabs!!!

    I have a quick newbie question: is there any possibility to add two or more webparts in the same TAB ?
    I have removed in the second web part “Chrome Type” = “none” that I want to keep after my first web par in the same page, but its not working.
    Please, let me know

    Thank you, Fabio Istvan

  64. One feature I’d love added is this. Click once to select the tab and view the webpart. The 2nd click on the ‘Live’ tab would then take you a specified url.

    Also what may be nice would be pop up text you can add to a tab that would explain it’s contents.

    Regarding V4 I noticed you have ‘Lite’ against it. Is there going to be a ‘Pro’ version we can purchase with extra features?

  65. Hello! Easy Tab is great! I have this problem, however: I am displaying a calendar in list view on my page, which fit nicely into Easy Tabs; but before I could click on the title to jump to the calendar. Now, since Easy Tabs uses the title to display the list in the tab, then it doesn’t hyperlink (which is right), but where do I stick my hyperlink? I would like to add a CQWP with some links to appear above Easy Tabs, but Easy Tabs sucks up ALL web parts into the tabs! I want to have the links always visible above the tab bar. What can I do?

  66. Christophe,

    I would like to try this web part but I’m running into a problem. I selected the options and imported the file into the Gallery. I get the following message:

    “The file you imported is not valid. Verify that the file is a Web Part description file (*.webpart or *.dwp) and that it contains well-formed XML. ”

    I apologize if this is due to a rookie mistake 😦

  67. Hey Chris! Great work! One question though. I’m using this tab to display document libraries. When a user clicks on the sub folder, it remains in that subfolder until the whole page is reloaded. Is there anyway to have this script setup so when a user exits a tab it will bring them back to the root of the previous tab?

    For example.

    If I clicked on a subfolder in tab 1 – the page refreshes and shows the sub folder.
    If I go into tab 2, then back to tab 1 – it’s still in that subfolder. The only way to leave the subfolder would be to click “back” on the browser.

    If this is not possible, is there a way I can show my document library hierarchy in the document library?

    Thanks!

  68. Could somebody also comment on how to make B.J’s version of the script work? I would really like to be able to add anchor links to these tabs, thanks!

  69. Wonderful WP.. solved a lot of problems with our site.
    Many Many thanks for producing it..

  70. Here is the whole code.

    /* Easy Tabs for Web Part pages – v 2.0
    Christophe Humbert
    Christophe@PathToSharePoint.com */

    var TabCookie = “TabCookie” + window.location.pathname;

    function GetParentTable(elem)
    {
    while(elem !=null && elem.tagName !=”TABLE”) elem=elem.parentNode;
    return elem;
    }

    function activateTab(selectedtab)
    {
    if (WPzone.id != “MSOZone”)
    {
    var allTabs = document.getElementById(“EasyTabs”).getElementsByTagName(“SPAN”);
    for (i=0;i<allTabs.length;i++)
    {
    var WPCellID = allTabs[i].id.replace(/tab/,"MSOZoneCell_");
    var TitleID = allTabs[i].id.replace(/tabWebPartWPQ/,"WebPartTitleWPQ");
    if (allTabs[i] == selectedtab)
    {
    allTabs[i].className = "ms-tabselected";
    document.getElementById(WPCellID).parentNode.style.display = "";
    document.getElementById(TitleID).parentNode.style.display = "none";
    }
    else
    {
    allTabs[i].className = "ms-tabinactive";
    document.getElementById(WPCellID).parentNode.style.display = "none";
    }
    }
    }
    }

    function BuildEasyTabs()
    {

    var TabsTD = document.createElement("TD");
    TabsTD.className = "ms-siteactionsmenu";
    TabsTD.id = "EasyTabs";

    var SeparatorTD = document.createElement("TD");
    SeparatorTD.style.height = "5px";
    SeparatorTD.className = "ms-pagetitleareaframe";

    var theDIVs = WPzone.getElementsByTagName("DIV");
    for (i=0;i’-1′)
    {
    var urlAnchor = pageUrl.substr(pageUrl.indexOf(‘#’)+1, pageUrl.length).replace(/%20/gi, ” “);
    if (urlAnchor.indexOf(‘?’)>’-1′){urlAnchor = pageUrl.substr(pageUrl.indexOf(‘#’)+1, urlAnchor.indexOf(‘?’));}
    }
    //End Section added by B.J. Davis

    Easy Tabs for Web Part pages – v 2.0
       Christophe Humbert
       Christophe@PathToSharePoint.com
    – This WebPart should be set to Hidden.
     – Select Modify Webpart.
      – Layout
       – Check the Hidden Checkbox.

    • Hi B.J.

      I’ve tried your script but it only breaks my tabs can you explain the script that you’ve added? and what code you have removed from the original. thanks.

      Thank you.

  71. I am trying to get the Easy Tab to work in a Publishing page. I see the tabs created when I add the Web part, but when I exit edit view I do not see the tabs. I don’t understand why there is a difference. Has anyone seen this problem before?

    Thanks

    Dave

    • I figured out what was going on. I see where you are capturing the TitleID.

      Should have taken another look at the code.

      Thanks

  72. how can I be able to display another Tab by clicking on the current page object let say hyperlink or area map of that tab that I’ve wanted to display?without clicking the tab.

  73. Can this be modified to use on a list item or even document properties?

    I have a list with a large number of columns and would like to be able to use tabs to make the list form easier to use.

  74. Christophe, I am try to see if Easy Tabs web part supports query strings. I only saw one other comment about this in the blog posts above.

    I am interested to see if there is way to set the active tab via URL so that when the page with Easy Tabs opens, such that you can specify the Active tab or tab with focus.

    thank you, mark

  75. FOA, thank you for the excellent webpart. My question is how do I config the Easy Tabs v 2.0 to show the second row of tabs. I have 4 tabs. I am not able to find any instructions.

    Thank you so much for such a great webpart!
    Lake

  76. Is it possible to overlap closed tabs? That is, if I have a long list of tabs that have long title, can I truncate the inactive tabs to only display the first x characters, while the active tab displays the full web part Title?

    • Sure, you could do this, but it would require to modify the code.

      Alternately, if you only use Internet Explorer, you could use the ellipsis style (do this on version 5 of the Easy Tabs, which has a separate stylesheet).

  77. First — thank you for all the hard work and wonderful innovations you’ve shared with all of us!

    I am using your tabbed web part in SP2010 — and the problem I’m having is that when I select a tab, the web parts drop farther and farther down the page — showing where they originally added to the page.

    How can I make that stop happening? I don’t recall it happening in 2007.

    Thanks so much,

    Amy

      • HI,

        I actually went into the HTML for the page itself and deleted the extra paragraph marks. I guess I was sloppy when inserting web parts.

        When I made a second set of tabs, I was very careful about where I put my cursor when I inserted the web part.

        Thanks so much for this — I particularly like the color options!!

        Amy

  78. Hi Christophe, I’ve been using EasyTabs for some time now and wonder if it would be possible to display them in a different way other than in a line across the top. What I would like to be able to do is have each ‘tab’ the full width of the web part and stack them one on top of the other. The ‘clicked’ tab then expanding to show the contents in situ in the vertical list of what are essentially the web part title headers.

    Essentially what I’m after is a combination of Brandon Andersons ‘Collapsible Web Parts in a Zone’ – http://www.endusersharepoint.com/2010/03/23/collapsible-web-parts-in-a-zone-using-jquery-for-sharepoint-2007/ – with the EasyTab functionality to close all web parts other than the one selected.

    Any guidance or pointers of how this might be acheived would much appreaciated.

    Thanks as ever for all the great ideas and solutions you publish,

    David

  79. EasyTabs is just that – Easy! We have a task list with about a dozen views for different stages of a production process. Everyone can see what stages various items are at quickly.

    We use workflows to move between stages. I have hung the workflows on the List Item Menu within each tab (in SPD).

    There is one problem, however. After each workflow is finished, it returns the user to the default view of the list /subsite/Lists/listname/allitems.aspx, rather than to the default page of the subsite (where EasyTabs are) (/subsite/default.aspx).

    Have you (or anyone reading) come across this behavior, and if so, do you know how to fix it?

    Thanks.

    • Warren, what do you mean by “it returns the user…”? SPD workflows usually interact with the lists, not with the current pages.
      For SharePoint redirects, one option you could look into is querystrings, and specifically the “Source” parameter. It allows you to specify a URL the user will be redirected to after the action on a page is completed.

  80. Hi Christophe, i’m a new easytab user, i will like to knw if by anychance, u can send me the code for the accordion mode of this Tool.
    I will really appreciate it, this is the only issue stoping me from meeting my timeline.
    i await ur mail.
    Thanks in advance

  81. Christophe,
    Thanks for the great webpart. Is it possible to select which webparts in the zone should be displayed as Easy Tabs ?

    I have one simple requirement to start with. I am trying to display a Header (CEWP) on top of EasyTabs but can’t as it becomes a tab by itself. My webparts in the zone categorize different kinds of applications and I would like to have a header “Applications”.

    • With the current version, the easiest way is to put the header in another Web Part zone, above the tabbed zone.
      An alternate option is to hard code the header, and insert it the same way the tabs are inserted in the page.
      This is a frequent request and I’d like to include it in a future release. But making this works for all configurations is not easy.

  82. Christophe,
    I love the EasyTabs functionality, but need to be able to use it in more than one webzone on a single page. What I find is that when I add the EasyTabs webpart to more than one webzone on a single page, all of the tabs are located at the first webzone. Any thoughts on how I could utilize EasyTabs within multiple webzones on the same page so that the tabs are located at the top of each different webzone? I’m looking to use this within 5 different webzones on one page. Thanks for any help in advance!

  83. Christophe, Firstly – thanks for sharing your great ideas… I have a some feedback and a question: – I’ve added the EasyTabs v5 script onto a non-English language site page and got an extra tab appearing which was actually the EasyTabs script CEWP. Upon investigating, I quickly found that if I replaced the ‘Hidden’ literal in the script with the local language used on the site (e.g. in French ‘Masqué’, or simplified Chineses = 隐藏), the correct behaviour was restored. Great! Not a problem to do this by hand but I’d like to add a web part for users to pick up the script which I’ve already branded with the SharePoint theme colours we are using. Is there another way of identifying the hidden attribute in the script to save me from creating lots of web parts for different langauges? thanks.

  84. Thanks for such a nice wp. Is it possible to set one of the tabs as default tab, so that it shows defaulted tab for that user each time the page is visited. If not, which part of the code decides to show first tab, maybe i can try to modify that.
    zieglers

  85. Hi, Christophe!
    My name is Katherine, I use SharePoint 2010 in my company.
    Today, I’m struggling with the following idea whole day long.
    Actually, I’m a new born SharePoint user^^.
    In my company is using sharepoint for the request for new customer or vender requisions.
    There are so many fields to fill in. So, I need to drag down a lot. It’s really inconvenience for users.
    That is why, if I can apply this easytabs in the list, it will be very helpful.
    But, the problem is this fields are in one webpart(? or list data?).
    So, can you help me how I can apply tabs in one data field?

    Sorry for my poor explanation.
    I will look foward your reply on it.

    Thank you very much. Christophe!

    I want to adopt easytabs in a list item.

    Could you help me on this?
    I

  86. I’m using EasyTabs to display different views of the same calendar. However, when I toggle from one tab to the next, all of the events get “squished” into the “Sunday” column on the left side of the page. I have to hit F5 to refresh the calendar view every time. Is there a solution for this issue?

  87. First of all… it’s been great reading through all these comments… learnt so much. I did have a question which I couldn’t find the answer to tho… I’ve been using easy tabs for about 3 weeks now… worked well all this while up till my third tab.

    However now that I’ve added a fourth tab, the contents of the tab appear on top of the third tab section. Instead of under the fourth tab.

    Why is this happening? Any ideas?

    • @drudra – check to see if any of the webparts are Custom Content and may have special css styling applied to them.

  88. Hi Christophe,
    is it possible to jump directly on one tab via URL?
    In simple CEWP you can set an anchor via Name.
    Then you can jump directly to it by extend the URL: …/index.aspx#anchor.

    Is it also possible using EasyTab?

    Greating
    Katrin

  89. Hello Christophe,
    I have a question. I am using the latest version in SP2010. We are using it to streamline a Policies & Procedures site, and I had a problem. When clicking the Print Preview tab everything looks great on screen, but when I actually print it some webparts overlayed the text on the second page. I modified your code (CSS) like this, and was wondering if this is the best solution, or perhaps you can offer an alternative? Many thanks!

    Your code:
    /*.et-offscreen{position:absolute;max-height:1px;max-width:1px;top:-99999px;}*/
    My change:
    .et-offscreen{display:none;}

    • The idea is to get all the other Web Parts as far of the screen as possible. I think adding a 9 works great, and I should actually do it in the published solution.
      Another option would be to use left instead of top, but it myight not work in some languages that do right to left.
      The last option is to use display:none, but I have explained its drawbacks in another article.

  90. NIce tabs for SharePoint. I have a tab setup with a Form Library View WebPart. When the page loads I can select a document and I get the Edit Document on the Ribbon. If I sort or filter the view on Created By, select a document, the Edit Document is greyed out. Any idea why?

  91. Hi Chris, Thanks for your easy tabs v5 code. The tab functionality is working fine. But I dont want the tabs to redirect to webparts in the same page. Instead I need each tab to direct to a different sharepoint subsite. i.e I need to specify a url that can be linked to each tab.

    • Hi Chris, Thanks for your easy tabs v5 code. The tab functionality is working fine. But I dont want the tabs to redirect to webparts in the same page. Instead I need each tab to direct to a different sharepoint subsite. i.e I need to specify a url that can be linked to each tab.

    • In this case you don’t need the Easy Tabs at all! You don’t even need a SharePoint specific solution. Just use a regular menu that works for any website.

  92. Hello, Christophe, how can I get easytabs to work correctly using custom aspx (wiki) pages? If I use page-viewer web-parts, the navigation gets shown inside the web-part.

    Also, I am using a custom master page, and it seems that the Print Preview and Expand buttons don’t get any focus or active styling. The other tabs work fine, however.

    • I don’t know… I’d suggest that you try with the latest version of the Easy Tabs (v5), available in the SharePoint User Toolkit.

      For the record, the other script contains some unconventional JavaScript (outerHTML). It’ll break in browsers other than Internet Explorer.

      • Hi Christophe,

        Thanks for your reply. I used v2 as I’ve seen v5 is in beta phase only and didn’t want to put non released version in our Production system yet.

        The current browser is IE in my company, therefore not that much of an issue with the outerHTML, but thanks for the advice, I will look at something else to make sure it works regardless of the browser.

        In factm your script is somehow rewritting urls as well, as normally the Title has its own url, that links to whatever you want, but then you use the Title as text for the tab and clicking on that text will display the content of the tab, instead of what you define as an url in the options panel.

        I will have a look at v5 anyhow, see the differences.

        Thank you

  93. Good afternoon sir,

    Thanks for making your work available to us all. I am trying to apply your EasyTabs wp in SP 2007 and I am running into a problem.

    I downloaded and imported EasyTabs as directed, so far-so good. The tabs appeared at the top of the zone and everything looked good. Then I exited the edit mode and the tabs went away.

    If I go back to the edit screen I see the tabs again and the (hidden) web part but they go away again when I exit the edit mode.

    Also, I have downloaded v5 but I have not been successful in importing it to SP. I keep getting an error indicating that it is not a valid file.

    Any thoughts on what I may be doing wrong?
    Steve

    • Steve, read the instructions carefully as they have evolved between versions. My guess is that you are doing something wrong when positioning the Web Part on the page. Also, I am not sure what you mean by importing, the v5 code is meant to be uploaded to a library and used with a Content Editor Web Part.
      Hope this helps!

  94. No, the web part is positioned at the bottom of the page as directed. I have set this up as identically as I can between the two different sites I mentioned earlier. It works fine on one site and not on the other.

    That is why I assume that there is something about the one site in perticular that is causing the problem.

    We have other teams that are using this tool successfully on other site collections as well. So I just have to “peel the onion” one layer at a time until I find the thing that s breaking “Easy Tabs” on that one site.

    If I find it, I will pass it along to you.
    Best regards,
    Steve

  95. Do you have the code to stop the Reloaded pages from remembering the active tab? we are need the first tab to be loaded each time the page is reloaded.

  96. I’m experiencing inconsistent results when using the Easy Tabs as indicated in the video. It will work fine on one or two pages then when I perform the identical procedure on a third page, the easy tabs do not appear. The various web parts show up one under the other. Please suggest.

  97. Pretty nice post. I just stumbled upon your weblog and wanted
    to say that I have truly enjoyed surfing around your blog posts.
    After all I will be subscribing to your feed
    and I hope you write again soon!

  98. Is there a way to navigate to an EasyTabs page, perhaps using a URL filter, so that a specific tab is selected when the user arrives?

    • This option is not implemented by default in the Easy Tabs, it is only available in the commercial version (SPELL Tabs). You would need to pass the active tab information in the url, and have the code read it. The main issue (often a source of discussion with the SPELL Tabs users) is how to choose the active tab depending on the user action (first page load vs. refresh).

  99. Hi All,

    I have successfully implemented it for 4 CEWPs but I am not able to do the same for 5 Excel Web access webparts. The tabs appear as expected while in edit mode along with the desired spreadsheet, but once I come out of the edit mode, I am not able to view the spread sheets any more; instead it remains blank and white. Kindly suggest any workaround for this.

    Also it would be really helpful if you can confirm whether this requirement can be achieved by any other easier method or not. Actually the requirement is that I have one Excel file which has 5 worksheets , each having a specific report or pivot table and I need to display all these 5 reports in a web-part page and it should ideally take the space of a single Excel Web access web-part (i.e. display them in a tabbed format or something equivalent)

    It will be really great if someone has a solution/suggestion/advice for this and thanks in advance 🙂

    And Chris, I really wish that MS upgrades their SP platform such that trouble times, a single press of F1 would have opened your blog as a helping resource instead of the content they have named as ‘Help’ 🙂 🙂

    Regards,
    Koushik.
    Chennai, India.

Comments are closed.