Jaap Vossers' SharePoint Blog

Just another WordPress.com site

Released: SharePoint InlineSiteSettings

with 4 comments

As a SharePoint developer, I have to navigate to the Site Settings page literally hundreds of times a day. I was getting fed up with the amount of steps required and the time involved to get to the Site Settings page.

For a WSS site:

  1. Move mouse to Site Actions menu
  2. Click Site Actions menu
  3. Move mouse to Site Settings menu item
  4. Click Site Settings menu item
  5. WAIT for page to load…

For a MOSS site:

  1. Move mouse to Site Actions menu
  2. Click Site Actions menu
  3. Move mouse to Site Settings menu item
  4. Move mouse to Modify All Site Settings menu item
  5. Click Modify All Site Settings menu item
  6. WAIT for page to load…

What’s that, 5 seconds maybe? Times 100?

If you are a good developer, your brains are likely to be moving faster than your hands. Having the system respond to your input without making you feel that you are being slowed down by it will greatly improve your development experience. To get into – and stay in – “the zone” you should not break that chain of quick commands. Shortcut, tab, tab, type, enter, mouse, click, f5, alt+tab, shortcut, woohaa – ninja mode!

This article is about a free solution that I developed that eliminates a painful sequence of mouse movements and clicks by replacing it with a single keyboard shortcut. Not only that! It will introduce direct navigation paths between pages that were not linked before. Navigate from Site Features to Site Content Types? From Content and Structure to Master Page Gallery? How?

  1. Keyboard shortcut
  2. Click link

SharePoint InlineSiteSettings will allow SharePoint users to press Ctrl+s to instantly access the Site Settings of the site belonging to the page you are currently on. It will actually be displayed inside the page you are currently viewing, at the top.

How does it work? SharePoint InlineSiteSettings performs an AJAX call to settings.aspx and extracts an html fragment from the response. This fragment is the table containing all the links that appear on the Site Settings page. By the time the user triggers the keyboard shortcut, the html fragment has already been loaded into the DOM of the current page, and only needs to be made visible – which is exactly what the javascript event handler for the keyboard shortcut does.

SharePoint InlineSiteSettings uses jQuery to perform the AJAX call, enable keyboard shortcut event handling (using the jQuery HotKeys plugin) and perform DOM manipulations.

SharePoint InlineSiteSettings has been implemented as a WebControl that will render mainly javascript, Certain properties can be set on the WebControl to customize its behavior. To allow deployment via a feature, I originally intended to implement a Feature that would use the AdditionalPageHead delegatecontrol. I soon found out that the BlueBand.master masterpage (which is the default master page for a publishing site) does not contain the AdditionalPageHead delegatecontrol, which meant that it would not work on a OOTB publishing site. For this reason, I came up with the alternative idea of implementing a custom Site Actions Menu Item that would not really render a menu item, but would only drop the javascript in the head of the page.

In terms of deployment, you can choose whether you prefer to add the WebControl to your master page, or activate a Feature that will register a custom Site Actions menu item. In the latter scenario you have the option of specifying if you want preloading turned on or off. This is done by activating one of the two available site collection scoped Features: InlineSiteSettings vs InlineSiteSettingsNoPreload. Make sure you only have one of these Features activated at a time. No preload basically means that the AJAX call to settings.aspx will be performed as you trigger the keyboard shortcut, which means you will save bandwidth at the price of response time.

The assembly that contains the InlineSiteSettings WebControl also contains the jQuery and HotKeys javascript libraries as embedded resources. These will be references automatically by the InlineSiteSettings WebControl, unless you specify that you do not want this to happen. This can be cone by setting the appropriate properties on the InlineSiteSettings WebControl. This is only possible if you add the InlineSiteSettings WebControl to your master page.

SharePoint InlineSiteSettings is published at CodePlex. It comes with a WSP that will deploy the Features and the required DLL. This DLL will be deployed to your bin folder and comes with a custom CAS policy.

Download SharePoint InlineSiteSettings @ CodePlex

Written by jvossers

March 19, 2009 at 12:14 am

4 Responses

Subscribe to comments with RSS.

  1. Very sweet.

    I dare you to rewrite this into a pure JavaScript solution and insert it on every page using our free SharePoint Infuser.

    I’d use it.

    See http://www.muhimbi.com/blog/2009/07/massage-sharepoint-into-submission.html

    Jeroen Ritmeijer

    July 31, 2009 at 11:24 am

  2. Excellent and simple script Jaap. I went to the SUGUK and watched you perform the Demo and I even won one of book “JQuery in actions” you kindly gave out at the end of your talk.

    But I had a problem testing it on our Dev MOSS box and I had been scratching my head wondering why it was not working until my colleague and I used firebug to walk through the code. It turns out the offending line was:

    // var hasPermissions = $(“[id$=’_MenuItem_Settings’]”).size() > 0;

    // if(hasPermissions)

    We commented these two lines out and it started to work what is the ‘_MenuItem_Settings’ referring to?

    I had site collection privileges on the test site.

    I tested the script by logging in as a visitor and when I crtl+s on the page and the only option that appears for them is the content and structure option which I thought was strange.

    Any ideas why I would be have a problem with the above line?

    Steven Summon

    November 18, 2011 at 10:30 am

  3. Hi Steven,

    what the code is trying to do is check if the Site Settings menu item exists in your Site Actions dropdown. If it does, it knows you have permissions to access Site Settings. If it doesn’t exist, it assumes you are more of a reader, who cannot access Site Settings anyways, so it won’t bother responding to ctrl+s. Can you confirm the Site Settings menu button exists?

    Also, I am not sure if I tested this solution in FireFox. Can you try IE as well? Perhaps SharePoint renders the Site Actions menu differently when you use FireFox as your browser.

    Thanks,

    Jaap

    jvossers

    November 18, 2011 at 10:38 am


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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: