Question

I am trying to add a custom button to the ribbon on the Page Tab. I have successfully done this with SharePoint 2010 and 2013, but not sure why it's not working with 2016. I am using the Elements.xml file just like I used in 2010 and 2013. Here is the custom action I'm using to try and add the button to the ribbon...

<CustomAction Id="CustomActionID" Location="CommandUI.Ribbon">
<CommandUIExtension>
  <CommandUIDefinitions>
    <CommandUIDefinition Location="Ribbon.WikiPageTab.Groups._children">
      <Group Id="CustomActionGroupID" Title="GL" Template="Ribbon.Templates.Flexible2" Sequence="120">
        <Controls Id="CustomActionControlsID">
          <Button Id="CustomActionButtonID"
                  Command="CustomActionButtonCommand"
                  Sequence="1"
                  Image32by32="/_layouts/15/images/Icon.png"
                  LabelText="Content"
                  ToolTipTitle="Content" ToolTipDescription="Exports." TemplateAlias="o1" />
          <Button Id="CustomActionButtonID2"
                  Sequence="2"
                  Command="CustomActionButtonCommand2"
                  Image32by32="/_layouts/15/images/Icon.png"
                  LabelText="Site"
                  ToolTipTitle="Site" ToolTipDescription="Exports site titles." TemplateAlias="o1" />
        </Controls>
      </Group>
    </CommandUIDefinition>
    <CommandUIDefinition Location="Ribbon.WikiPageTab.Scaling._children">
      <MaxSize Id="DocExportMaxSize" Size="LargeLarge" GroupId="CustomActionGroupID"/>
    </CommandUIDefinition>

  </CommandUIDefinitions>
  <CommandUIHandlers>
    <CommandUIHandler Command="CustomActionButtonCommand" CommandAction="javascript:Export('{SiteUrl}', '{ListId}');"

  EnabledScript="javascript:
      function enableExport() {
            return true;
      }
      enableExport();
"/>
    <CommandUIHandler Command="CustomActionButtonCommand2" CommandAction="javascript:SiteTitleExport('{SiteUrl}', '{ListId}');"

    EnabledScript="javascript:
      function enableExport() {
            return true;
      }
      enableExport();
"/>
  </CommandUIHandlers>
</CommandUIExtension>

I'm using is a 2016 Farm Solution template.

Was it helpful?

Solution

It appears the xml was correct, but the Feature in the solution was set to Web rather than Site. This is the reason it was not showing up in the ribbon on aspx pages

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top