For all SharePoint end users: an expand/collapse bookmarklet

In the past two years, I have published multiple solutions for site owners, allowing them to enhance their SharePoint sites without the need for server side deployments.

These solutions, however, can’t be used by the majority of the SharePoint population: end users who only have read or contribute rights. To remedy this, I am going to release in the next months solutions open to all SharePoint users.

How do these solutions work?

All browsers allow you to save URLs. This feature has different names: favorites in Internet Explorer, bookmarks in other browsers like Firefox and Safari. What is less known is that these Favorites/Bookmarks can also include code. In this case they are called bookmarklets (or favelets).

If you select a bookmark, the browser will load the corresponding page. If you select a bookmarklet, the browser will remain on the current page and run the script. It is as simple as that.

Warning! Bookmarklets can contain malicious code. Only use bookmarklets from trusted sources.

The first bookmarklet I am releasing today allows you to add expand/collapse buttons to the Web Parts present on a SharePoint page. It works in both SharePoint 2007 and 2010. I compacted the code to less than 500 characters, to make it compatible with older browsers.

Try it, now!

First, you need to grab your bookmarklet. Go get it on my SharePoint User’s Toolkit:
http://sp2010.pathtosharepoint.com/SharePoint-User-Toolkit/Pages/Bookmarklet-Expand-Collapse-Web-Parts.aspx

Once you have your bookmarklet, head out to a SharePoint home page and apply it. Again, you only need read access, so you can try it out on the home page of the Chicago User Group (SP 2007), or the San Diego User Group (SP 2010), as I did:

For site owners, I’ll publish a slightly different and more robust version that can be included in the page ( it won’t have the 500 character limit constraint). Actually there’s already one available on my blog, but, as the code is already two years old, it is time for a new release.

Have fun!

  1. Nice for collapsing but clicking again on the bookmarklet won’t expand, it adds plus and minus signs on the webpart title.

    • Patrick, the role of the bookmarklet is just to add the +/- buttons, you are not supposed to use it more than once on the page. After the buttons are on the page, next to each Web Part title, use them to expand/collapse the Web Parts.

    • Mark
    • March 30th, 2011

    Nice. I’d like to see a bookmarklet that expands all groupings within existing web parts on the page though.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 214 other followers