Here is a simple feature manifest:
<?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/"
Id="5DFD12AF-D0AA-4c63-8FB8-C49DB1191083"
Title="My Site Content Type Feature"
Description="Adds my Content Types."
Scope="Site"
Version="1.0.0.0">
<ElementManifests>
<ElementManifest Location="ContentTypes.xml"/>
</ElementManifests>
</Feature>
Here is a elements manifest which adds ECB menu for a infopath form content type:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction
Id="NIBR.NimbusStatusReport"
Location="EditControlBlock"
Title="(Nimbus) Display in SharePoint...."
Sequence="10"
RegistrationType="ContentType"
RegistrationId="0x010100AF717F1A25C33E438J00D81D31F0A176">
<UrlAction Url="{SiteUrl}/Pages/StatusReportViewer.aspx?item={ItemUrl}"/>
</CustomAction>
</Elements>
The stuff worth noticing here is the RegistrationType and RegistrationId attributes
RegisterationType should be set to ContentType and RegisterationId should be set to the document content type or the parent contenttype if you want to enable the ECB menu for all items deriving from the parent Content Type.
To create a new ID for a content type you can follow one of two possible conventions:
[parent content type ID] + two hexadecimal values (different from "00")
[parent content type ID] + "00" + hexadecimal GUID
Usually the first convention is used by SharePoint for the default content types included in SharePoint.
Example:
0x (System)
0x01 (Item Content Type)
0x0101 (Document Content Type, child of Item Content Type)
0x0120 (Folder Content Type, child of Item Content Type)
Once we are done with building the feature it's time installing and activating. Follow the following stsadm commands to get it in place.
installfeature:
stsadm.exe -o installfeature
{-filename
-name
[-force]
activatefeature:
stsadm.exe -o activatefeature
{-filename
-name
-id
[-url
[-force]
uninstallfeature:
stsadm.exe -o uninstallfeature
{-filename
-name
-id
[-force]
It's all done !! Enjoy your first feature