将新的自定义按钮添加到功能区时遇到一些问题。如sharepoint 2010 SDK(如何:修改用户界面使用自定义操作)中所述,我创建了一个Visual Studio项目并复制了应创建新按钮的xml代码。下面是代码:SP2010:如何在功能区中创建新按钮
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction Id="ListViewCustomization" Location="CommandUI.Ribbon.ListView" RegistrationId="101" RegistrationType="List" Title="List View Ribbon Customization">
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition Location="Ribbon.Documents.Share.Controls._children">
<Button Id="ListViewButton" Command="ListViewButtonCommand" Description="Go to Settings" LabelText="Site Settings" TemplateAlias="o2" Sequence="93"/>
</CommandUIDefinition>
</CommandUIDefinitions>
<CommandUIHandlers>
<CommandUIHandler Command="ListViewButtonCommand" CommandAction="/_layouts/settings.aspx" />
</CommandUIHandlers>
</CommandUIExtension>
</CustomAction>
</Elements>
我检查了我的网站集的站点设置,以及新功能的结果被激活,但周围没有新的按钮。 我错过了一些步骤?
圣牛你是对的,那个按钮就在那里!显然,我不是在看一个文档库,而是在一个列表中(因为标题是“向LIST表单添加一个按钮”)。那么我该如何将该按钮添加到列表选项卡?我需要什么RegistrationId? – Maik 2010-10-14 14:02:07
@Maik SharePoint列表模板ID http://sharepointkb.wordpress.com/2008/08/26/sharepoint-list-template-ids-registrationids-list-template-type-ids/ – 2010-10-14 14:16:30
实际上,该ID代表列表模板ID。因此,这取决于您是使用自定义列表模板(在这种情况下,您将拥有自己的ID),还是使用现有列表模板之一创建列表。如果您从现有列表模板创建列表,则需要查找列表模板的列表模板标识。检查Sharepoint SDK中的“ListTemplateType Enumeration” – 2010-10-14 14:16:34