I have document library and i want to add button that will be visible only for my content type:
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- Parent ContentType: Document (0x0101) -->
<ContentType ID="0x0101005e4b5d5098e94baba80f8d1ccf9eb507"
Name="MyCustomDocument"
Group="MY Content Types"
Description="MyCustomDocumentcontent type"
Inherits="TRUE"
Version="0">
<FieldRefs>
</FieldRefs>
</ContentType>
</Elements>
How can i do this in sharepoint 2010?
I have example of code but its doenot working:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction Id="ExportVersionHistory.DisplayForm" Location="CommandUI.Ribbon"
RegistrationType="ContentType"
RegistrationId="0x0101005e4b5d5098e94baba80f8d1ccf9eb507"
>
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition Location="Ribbon.Documents.Manage.Controls._children">
<Button
Id="Ribbon.Documents.Manage.OpenInWizard"
Sequence="40"
Command="Ribbon.Documents.Manage.HelloWorld.cmdSayHelloWorld"
Image16by16="/_layouts/1033/images/formatmap16x16.png" Image16by16Top="-144" Image16by16Left="0"
Image32by32="/_layouts/1033/images/formatmap32x32.png" Image32by32Top="-128" Image32by32Left="-256"
LabelText="Hello World"
ToolTipTitle="Click button to prompt 'Hello World'"
ToolTipDescription="Once you click this button, you will get a hello world dialog box "
TemplateAlias="o1"/>
</CommandUIDefinition>
</CommandUIDefinitions>
<CommandUIHandlers>
<CommandUIHandler
Command="ManoInc.Ribbon.Documents.Manage.HelloWorld.cmdSayHelloWorld"
CommandAction="javascript:alert('Hi Mano');" />
</CommandUIHandlers>
</CommandUIExtension>
</CustomAction>
</Elements>
Position where I want to locate my button:
When i am removing those lines:
RegistrationType="ContentType"
RegistrationId="0x0101005e4b5d5098e94baba80f8d1ccf9eb507"
Button becomes visible for all my content types. What i am doing wrong and why my button doesnot visible for specific content type?
article http://howtosharepoint.blogspot.com/2010/06/ribbon-basics.html