Month: May 2008

EditControlBlock (ECB) menu item in SharePoint Wiki and Blogs

In a recent project, I had to add an ECB item (shortcut menu, context menu) for wiki pages and blog posts in Microsoft Office SharePoint Server 2007. It was a quest to find the right ContentType.

Sharepoint ECB

To add a menu item for Wiki, you can create a Custom Action in the Feature.XML of your SharePoint feature. Here is how you define the custom action:

<CustomAction

Id="MyCustomID"

RegistrationType="ContentType"

RegistrationId="0x010108"

Location="EditControlBlock"

Sequence="500"

ImageUrl="/_layouts/images/icdocx.gif"

Title="$Resources:ResourceFileName,contextMenuText;">

<UrlAction Url="/_layouts/Processor.aspx?ListId={ListId}" />

</CustomAction>

 

 

For blog posts in SharePoint, you will have to create the following Custom Action:

<CustomAction

Id="MyCustomID"

RegistrationType="ContentType"

RegistrationId="0x0110"

Location="EditControlBlock"

Sequence="467"

ImageUrl="/_layouts/images/icdocx.gif"

Title="$Resources:ResourceFileName,contextMenuText;">

<UrlAction Url="/_layouts/Processor.aspx?ListId={ListId}" />

</CustomAction>

Note that the scope of the Feature should be Site Collection as Blogs are separate sites in SharePoint.

You can extend almost every type of menu by creating a custom action for it. In SharePoint all you need is the following three links to implement a Custom Action:

  1. Add Action to Sharepoint User interface
  2. Determinte ContentTypes, Locations and Groups
  3. Confirm in Base Content Type Hierarchy

Welcome to my Blog

I have finally decided to take a plunge in the world of blogging.  My Blog Statement?

Let’s see –

Purpose

This is my web blog. My perspective, my views, my rant. A lot of posts on this blog will relate to stuff in .NET development that you don’t encounter everyday. A reminder for us developers. Helping a developer one at a time.

About

I work in the development space of Microsoft. I have passion for technology and believe that we should outsource a lot of stuff we do to computers. I will create / update an About Me page in coming days.

I encourage you to share your comments and thoughts.

Let’s Begin …