Document Libraries and Lists controls disappear when you add a webpart

I just noticed an odd behaviour – it seems that when you add a web part to a page that is related to a Document Library it hides the normal ribbon web part controls. Well, that sucks!

It did not affect the interface in 2007, but it appears as though they’ve built some logic in that says “If the page has a non-standard web part loaded, hide the ‘Library Tools’ controls”. It also puts the same web part on every other view page that is in the document library (which is kind of handy, but it does not leave you any way to get back to the Document Library settings pages).

The problem here is that the only way to then edit the document library settings is through SharePoint Designer… Does anyone see the flawed logic here?

Everyone loves pictures, so…

OTB Doc Library view (the ubiquitous allitems.aspx page)…

image

Add a web part (Content Editor Web Part for example) – Empty

Goooooooone!

Where are you Library Tools Tab? VVVimage

And out of edit mode…

image

Anyway, I suppose the only way to work around that issue is to create a page and insert the auto-generated library’s web part – at least the Document Library web pages then stay fully functional. Took me a while to realise what was going on – I thought some of the jQuery code I was putting in was hiding it by accident!

Cheers!

Brad

About Brad Saide

I'm a SharePoint consultant. I'm also slowly going bald, seem to have a permanent spare tyre around my waist and enjoy socialising with friends over a beer or 10. The last 2 may possibly be related. Started working with SharePoint when the first version was in limited beta release (participated in the Technology Adoption Program while at Woolworths) and have been committed to the adoption of the technology as a business enabler ever since.
This entry was posted in Uncategorized. Bookmark the permalink.

7 Responses to Document Libraries and Lists controls disappear when you add a webpart

  1. Rick says:

    Hi Brad,

    Here’s another work-around for you:

    1) Go into the edit mode for the page/library/calendar (Site Actions>>Edit Page) and edit the web part of the library/list/calendar
    2) Under “List View” select “Show Toolbar” and click “OK”

    With the proper permission you should see the “New”, “Actions” and “Settings” buttons at the top of your list. You can use the “Settings” button to access the List Settings. Or, if you click on the drop-down arrow next to “Actions”, all of the ribbon menus for the page miraculously reappear.

    Hope that helps 🙂

    • Brad Saide says:

      Good idea – Expose the toolbar at the top of the list / doc lib the same way you used to in SP 2007 – didn’t think of that.

      I still think it’s a poor way for the page toolbar to behave though 🙂 Thanks for sharing Rick!

  2. Talha Majeed says:

    Hi Brad,

    The toolbar in SharePoint 2010 gets active/deactive based upon the cursor location, if you have ur cursor on the listview webpart, the library tools will be displayed in the toolbar, if not, then it will disappear. In both of the above pics, you are doing the same thing, first you have only one webpart on your page and the cursor get focused on that webpart, that’s why the library tools get displayed, in the second figure, you have focused on the content editor webpart, that’s why the library tools get away. So, to view the toolbar again, just click in the area of the listviewwebpart, the library tools toolbar will be displayed 🙂
    Hope it helps.

    Regards,
    -Talha

  3. Ahmad Akshir says:

    function SelectWP(){
    //select first webpart
    var wp = document.getElementById(“_wpSelected”);
    if (wp != null){
    wp.value =”MSOZoneCell_WebPartWPQ2″;
    SelectRibbonTab(‘Ribbon.Document’, true)
    }
    }
    ExecuteOrDelayUntilScriptLoaded(SelectWP, “sp.ribbon.js”);

  4. It works…Thank you.
    To have the “Items” tab selected in the ribbon you need to give “Ribbon.ListItem” in the above script.

Leave a comment