Adding Tasks and Jumplists to Pinned Sites in IE9
In a previous post I explained what is site pinning and how you can pin a site to Windows 7 taskbar. In this post I’m going to explain how to add tasks and jumplists to the pinned site from the previous post example.
Adding Tasks to a Pinned Site
When we pin a site to the Windows 7 taskbar we can include tasks to operate on the pinned site. With this feature you can add tasks for common behavior of your site. For example, in a library site you can add a task to redirect to the last borrowed book page to help the user or a task for seeing the list of books available in the library.
So how do I achieve the tasks behavior? this is easy – use the new meta tag msapplication-task at the head of the web page. The msapplication-task has a content format of three parameters:
- name – the name of the task.
- action-uri – the link to perform when that task is clicked.
- icon-uri – the link for the icon to show beside the task.
This is an example of a task that redirect to my blog you can see the content format which expect the parameters to be comma delimited:
Here is the new head of the previous post example which include two new tasks:
Here is how it will be shown after the site pinning:
Adding Jumplist to a Pinned Site
- msSiteModeCreateJumplist – creates a new Jumplist.
- msSiteModeAddJumplistItem – adds an item to the Jumplist.
- msSiteModeShowJumplist – shows the created Jumplist.
- msSiteModeClearJumplist – clears the Jumplist.
Here is an example for a function that creates a simple Jumplist with one item:
In the example I’ve put this function in the head of the application master page (of course it should be a part of an external js file):
In the home web page of the application I added this script which uses the msIsSiteMode to check whether the site is pinned and if so call the AddJumpList function from the previous master page example:
Here is the pinned site with the added Jumplist: