您好我正在尝试在SharePoint的内容编辑器功能区的剪贴板组中添加自己的按钮。它没有出现在任何地方,这里是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>
答案 0 :(得分: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>