/ Personalisation

Personalization in SharePoint 2010

SharePoint Personalization, (or 'Personalisation' as us Brits would say in a slightly plumbier accent) is cool.

Picture the scene, you want to entice your end users to employ SharePoint in their daily toil. You want to persuade them it has something to offer. Day after day they dutifully log into the Intranet - their 'one stop shop' to everything useful on the network. The landing page has Company Announcements, Useful Links, Upcoming Events controlled by the company. All standard so far, except there in the right hand column of the page they've had the freedom to add an RSS feed of the latest BBC headlines, a local weather forecast, or an iFrame to a particular legacy system they use a lot. This view is completely personal with no impact on the guy in the next cubicle. Our worker is feeling empowered, this Intranet is relevant and useful!!

In some types of SharePoint sites it's possible for users to personalize the pages. Users can add and edit the webparts on a SharePoint page and only they will see those changes in their Personal View of that page. The company controls which part of the page can be personalized, so the essential information stays visible, and fixed in place. Who wouldn't want this?

The option isn't available for all types of page though. Specifically it's not supported on Publishing and Wiki Pages, and is intended for Web Part Pages. At least, that's the wisdom that seems to be floating around on the web, though I found things to be a little different as I'll explain below.

The option to personalize a page is available on the drop down menu of your name in the top right of the page. It looks like this;

Personalize Option



If you're not seeing this, check you're on a web part page, and check permissions are in place for personalization as per this link; Check Personalization Permissions

I've been telling clients and potential clients about the personalization features of SharePoint for years, and little interest has been shown. Though perhaps it's an idea whose time has come, because recently a client asked for the ability. Luckily I wasn't drinking from my coffee mug at the time or I might have choked. Finally someone wants this cool and underated feature!

The other reason to choke was that I knew what pages they wanted this on and they are Publishing Pages (dogma states not available here) plus to make things worse, the personal menu in the top right hand corner had been removed in their master pages and wasn't going to be available anyway!

So as is often the case in such matters a little experimentation was needed. I looked at the personalization view and noticed that to edit a personal view the page url always had a querystring like this;

http://YourUrl/foo.aspx?PageView=Personal&ToolPaneView=2

I added the querystring to other pages, and it allowed me to personalize both wiki and publishing pages along with web part pages. So much for the online dogma about personalization. :D

It was therefore easy to add a link to the masterpage like this;

<a href="?PageView=Personal&ToolPaneView=2">Personalise</a>

SharePoint fills in the current page address automatically when the page renders, so when you click the link you happily go into the personal edit view and see a menu on the right like this;

SharePoint Personalization Panel

You can drag webparts around and add new ones. Clicking the x to close the webpart window also saves your changes.

If you don't want users to tinker with all the webparts on a page, in the normal edit view (not the personalization view) you can untick the 'Allow Editing in Personal View' option in the Advanced settings of that particular webpart.

Allow Personalization

Note that you wont see all webparts in the Personalization Panel. Webparts need to be marked with the SafeAgainstScript property set to true, otherwise they're disallowed due to cross site scripting concerns. If it's a custom webpart you can set this property in Visual Studio when you're building it, and you can set it in the SafeControls entry in the web.config. If those options dont work it's also possible to go to Central Administration and set "Allows contributors to add or edit scriptable Web Parts", but it's a security risk so let's not go there.

Anyway, I digress. We were talking about personalizing the page. Now that the page is personalized when you visit it you see your personal view, not what everyone else is seeing. Hopefully in the person menu you see these options now;

Reset Personalize Option



You can go to the Shared View everyone else sees, or if you don't like your personal view you can click Reset Page Content and go back to only having a Shared View.

If you're not seeing those options, or like my situation you dont have the menu for some reason, you're going to be stuck with the personalization unless you add your own link.

This was less straightforward to work out. I had to look at the page source to discover how the reset was done. Instead of a querystring parameter this needed a call to a SP javascript method, which I placed in a link like so;

<a href="javascript:SP.SOD.execute('browserScript','MSOWebPartPage_RestorePageDefault');">Reset</a>

This brings up a dialogue asking you if you're sure you want to remove the personalization. If you click 'yes' predictable things happen. ;)

With these two links, you can allow users to personalize web part, wiki, and publishing pages (as long as they have some webpart zones!). A health warning though; this is a hack and may not be supported in future. Also I haven't tested all potential scenarios. Is it worth a bit of further investigation though? - Heck yeah!  :)

Happy SharePointing!

Personalization in SharePoint 2010
Share this

Subscribe to Cloud with a Sunny Outlook

Disclaimer: The software, source code and guidance on this website is provided "AS IS"
with no warranties of any kind. The entire risk arising out of the use or
performance of the software and source code is with you.

Any views expressed in this blog are those of the individual and may not necessarily reflect the views of any organization the individual may be affiliated with.