Quantcast
Channel: Developing Apps for SharePoint 2013 forum
Viewing all articles
Browse latest Browse all 8089

Ribbon custom action not showing up with SharePoint hosted app

$
0
0

I am trying to add a ribbon custom action from a SharePoint hosed app. I want it to show in the ribbon when a page is being edited. I have gotten this to work from an auto-hosted app, but not a SharePoint hosted app. Menu item custom actions are working. This is the elements.xml from my last attempt.

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction Id="81260f41-bc6b-407d-99b5-2ad6816780c7.RibbonCustomAction2"
                RegistrationType="List"
                RegistrationId="{$ListId:SitePages;}"
                Location="CommandUI.Ribbon"
                Sequence="10001"
                Title="Invoke &apos;RibbonCustomAction2&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.RibbonCustomAction2Button"
                  Alt="Request RibbonCustomAction2"
                  Sequence="100"
                  Command="Invoke_RibbonCustomAction2ButtonRequest"
                  LabelText="Request RibbonCustomAction2"
                  TemplateAlias="o1"
                  Image32by32="_layouts/15/images/placeholder32x32.png"
                  Image16by16="_layouts/15/images/placeholder16x16.png" />
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler Command="Invoke_RibbonCustomAction2ButtonRequest"
                          CommandAction="~appWebUrl/Pages/Default.aspx?{StandardTokens}&amp;SPListItemId={SelectedItemId}&amp;SPListId={SelectedListId}"/>
      </CommandUIHandlers>
    </CommandUIExtension >
  </CustomAction>
</Elements>

I am testing with a O365D developer site.

Thanks for any help,

Bill


Viewing all articles
Browse latest Browse all 8089

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>