0

Hi I'm trying to add my own button in the clipboard group of content editor ribbon in SharePoint. It's not appearing anywhere, here's the xml.

  <?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
 <CustomAction Description="Copy html"
            Id="68275191-272b-4c59-a9ee-ee736f76f2e5"
            RegistrationId="100"
            RegistrationType="List"
            Location="CommandUI.Ribbon"
            Title="Copy html" >
<CommandUIExtension>
  <CommandUIDefinitions>
    <CommandUIDefinition       Location="Ribbon.EditingTools.CPEditTab.Clipboard.Controls._children">
      <Button
          Id="copyHtmlSelection"
          Alt="Copy html"
          Sequence="100"
          Command="CustomRibbonButton_CopyHtml_Command"
          Image32by32="/_layouts/Images/copy_big.gif"
          Image16by16="/_layouts/Images/copy_small.gif"
          LabelText="Copy html"
          TemplateAlias="o1" />
    </CommandUIDefinition>
  </CommandUIDefinitions>

  <CommandUIHandlers>
    <CommandUIHandler
      Command="CustomRibbonButton_CopyHtml_Command"
      CommandAction="javascript:CopySelectedHtml();" />
  </CommandUIHandlers>

</CommandUIExtension>
  </CustomAction>

4

1 回答 1

2

从 CustomAction 元素中移除 RegistrationId 和 RegistrationType 并清除浏览器缓存。这对我行得通:

<?xml version="1.0" encoding="utf-8"?>sdf
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction Description="Copy html"
             Id="68275191-272b-4c59-a9ee-ee736f76f2e5"
             Location="CommandUI.Ribbon"
             Title="Copy html" >
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition       Location="Ribbon.EditingTools.CPEditTab.Clipboard.Controls._children">
          <Button
              Id="copyHtmlSelection"
              Alt="Copy html"
              Sequence="100"
              Command="CustomRibbonButton_CopyHtml_Command"
              Image32by32="/_layouts/Images/copy_big.gif"
              Image16by16="/_layouts/Images/copy_small.gif"
              LabelText="Copy html"
              TemplateAlias="o1" />
        </CommandUIDefinition>
      </CommandUIDefinitions>

      <CommandUIHandlers>
        <CommandUIHandler
          Command="CustomRibbonButton_CopyHtml_Command"
          CommandAction="javascript:CopySelectedHtml();" />
      </CommandUIHandlers>

    </CommandUIExtension>
  </CustomAction>
</Elements>
于 2012-11-13T08:58:36.493 回答