I am trying to add a custom button in the display form for a document library item. I managed to do it for Display form for a list item, but can't adapt it to a document library item, anyone have ideas what is needed to be change in order to work for document library item? I believe something in the Location attribute should be changed, but not sure in what way. Below you can see sample for the list item.
<CustomAction
Description="Search Title on Bing"
Title="Bing It!"
Id="{E538E8C7-65DA-454E-AD87-4A603B6CC569}"
Location="CommandUI.Ribbon.DisplayForm"
RegistrationId="100"
RegistrationType="List"
Sequence="0"
Rights="ViewListItems"
xmlns="http://schemas.microsoft.com/sharepoint/">
<CommandUIExtension xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- Define the (UI) button to be used for this custom action -->
<CommandUIDefinitions>
<CommandUIDefinition
Location="Ribbon.ListForm.Display.Manage.Controls._children">
<Button Id="{B511A716-54FF-4EAE-9CBE-EA02B51B626E}"
Command="{4E2F5DC0-FE2C-4466-BB2D-3ED0D1917763}"
Image32by32="_layouts/15/images/placeholder32x32.png"
Sequence="0"
LabelText="Bing"
Description="Search Title on Bing"
TemplateAlias="o1"
/>
</CommandUIDefinition>
</CommandUIDefinitions>
<CommandUIHandlers>
<!-- Define the action expected on the button click -->
<CommandUIHandler
Command="{4E2F5DC0-FE2C-4466-BB2D-3ED0D1917763}"
CommandAction="javascript:openDialog();
function openDialog() {
alert('Hello');
};
}
"/>
</CommandUIHandlers>
</CommandUIExtension>
</CustomAction>
</Elements>