0

How to add a custom action to the list ribbon?

The custom action should open a sitepage in modal popup.

2 Answers 2

3
<?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <CustomAction Id="9b3d1a59-78ca-45da-aa2c-4964e3f68c58.AppHost-RCA"
    RegistrationType="List"
    RegistrationId="100"
    Location="CommandUI.Ribbon"
    Sequence="10001"
    Title="Invoke &apos;AppHost_RCA&apos; action">
    <CommandUIExtension>
    <!--
    Update the UI definitions below with the controls and the command actions
    that you want to enable for the custom action.
    -->
    <CommandUIDefinitions>
    <CommandUIDefinition Location="Ribbon.ListItem.Actions.Controls._children">
    <Button Id="Ribbon.ListItem.Actions.AppHost-RCAButton"
    Alt="Request App"
    Sequence="100"
    Command="Invoke_AppHost-RCAButtonRequest"
    LabelText="Request App"
    TemplateAlias="o1"
    Image32by32="_layouts/15/images/placeholder32x32.png"
    Image16by16="_layouts/15/images/placeholder16x16.png" />
    </CommandUIDefinition>
    </CommandUIDefinitions>
    <CommandUIHandlers>
    <CommandUIHandler Command="Invoke_AppHost-RCAButtonRequest"
    CommandAction="~appWebUrl/Pages/Default.aspx"/>
    </CommandUIHandlers>
    </CommandUIExtension >
    </CustomAction>
    </Elements>
1
1

You can associate your custom action to a specific list by using the RegistrationId property.

Check this post, already have answer.

Show custom action in ribbon for only one list

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.