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

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>