I would create a custom ribbon in Sharepoint 2013. I created my APP-Sharepoint Hosted APP and I have added my Custom Ribbon . This Custom Ribbon, with a click under it, must open a dialog box or simply an alert.
I have used this code:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction
Id="ShowHelloWorldButton"
RegistrationType="ContentType"
RegistrationId="0x01"
Location="CommandUI.Ribbon.ListView"
Rights="EditListItems">
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition
Location="Ribbon.ListItem.Actions.Controls._children">
<Button
Id="Ribbon.ListItem.Actions.Controls.ShowHelloWorldButton"
Alt="Show HelloWorld Alert"
Sequence="1"
Image32by32="_layouts/15/images/placeholder32x32.png"
Image16by16="_layouts/15/images/placeholder16x16.png"
Command="ShowHelloWorldCommand"
LabelText="Hello World"
TemplateAlias="o1"
CommandType="General"/>
</CommandUIDefinition>
</CommandUIDefinitions>
<CommandUIHandlers>
<CommandUIHandler
Command="ShowHelloWorldCommand"
CommandAction="javascript:alert('Hello World');" />
</CommandUIHandlers>
</CommandUIExtension>
</CustomAction>
</Elements>
But I obtain this error:
Error occurred in deployment step 'Install app for SharePoint': There were errors when validating the App Package.
Why?
Thanks!