Gorgo.Live.ToString()

Mariusz, Gorzoch tech Blog

PET – let’s make it simple

leave a comment »

If you start with publishing, then on the beginning you will be amazed about all the goodness it’s brings. After a while you click the option “Site actions –> Create page” and you again amazed about the option you get there… and here pop-up the problem… you see the nice advance toolbar on the top of the page and you are starting to ask you an questions : what for those all options are… there is also even worst question : if I don’t know what to do with those option there, then how the hell my users will know how to use them ?… yep… this toolbar at first approach (especially at organization, when people are starting to use SharePoint) has to many options and quite new user can get lost quite fast. This happened in our environment, were the only button users were using here was “Publish”.

To address this problem I’ve created quite simple wsp solution, which you can deploy to your environment and instead of very advance PET toolbar:

you can use a little bit simpler one, which look like this:

Believe me or not – users will thank you for that, as they know what to do with those buttons, 😉

On the end of this post you can find link to “zip” solution written in Visual Studio 2008. In general this solution is around concept to replace “CustomEditingMenu.xml” and “CustomQuickAccess.xml” files located inside “_catalogs/masterpage/Editing Menu/” at root site collection level. This concept was described very nicely by Andrew Connel in his book SharePoint 2007 Web Content Management Development. In addition if you look at Microsoft site : http://msdn.microsoft.com/en-us/library/aa674506.aspx , then you can also find quite good reference about that.

In the nutshell what this solution is doing:

  • After deploying wsp package and deploying it, you will get new feature at site collection level
  • When feature is activated then it is backup current  version of those files with the pattern <filename>_CurrentDateTime and replacing those custom files with the one, were additional/advanced option are turned off
  • When feature is deactivated, then we making backup of current files (in case someone tweak them up) and restoring the one we backup during activation process.

Here you can find customization I’ve done to those files:

CustomEditingMenu.xml

<?xml version="1.0" encoding="utf-8" ?>
<Console>
  <structure>
      <ConsoleNode ConfigMenu="Delete"  ChangedNodeID="saPageSubMenu"/>
      <ConsoleNode ConfigMenu="Delete"  ChangedNodeID="saWorkflowSubMenu"/>
  </structure>
</Console>

As you can see what we are doing here is just to asking SharePoint to remove “SubMenus” we don’t want to show.

CustomQuickAccess.xml

<?xml version="1.0" encoding="utf-8" ?>
<Console>
  <references>
      <reference TagPrefix="cms" assembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" namespace="Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions" />
  </references>
  <structure>
    <ConsoleNode Sequence="0" Action="cms:SavePublishingPageAction" DisplayText="cms,console_savechanges" ImageUrl="/_layouts/images/saveitem.gif" UseResourceFile="true" ID="saSaveChanges" />
    <ConsoleNode Sequence="100" Action="cms:DeleteAction" DisplayText="cms,console_deletepage" ImageUrl="/_layouts/images/delete.gif" UseResourceFile="true" ID="saDeletePage" />    
      <ConsoleNode ConfigMenu="Delete"  ChangedNodeID="qaCheckin"/>   
  </structure>
</Console>

and here we adding new buttons based on definition for those action located inside file “EditingMenu.xml” placed at “C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\EditingMenu” folder.

Here you can find “zip” of Visual studio 2008 project: PublishManuSoluton.zip, have fun.

Advertisements

Written by Mariusz Gorzoch

13 November 2009 at 11:46

Posted in SharePoint

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: