Add new button Ribbon “Page” SP 2013 Ent
-
18-01-2021 - |
Решение
Only VS, this simple example is helped me:
- Open the visual studio 2012 as run as administrator.
- Create an Empty SharePoint Project.
- Select a Farm Solution.
- Add New Item to the solution.
- Add a Module. Name it as CustomRibbonActionModule.
- By default, it will have a sample.txt. Now delete that txt file, since we don’t require that.
- And modify the Elements.xml as below.
<?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <CustomAction Description="Open template" Id="68275191-272b-4c59-a9ee-ee736f76f2e5" Location="CommandUI.Ribbon" Title="Open template"> <CommandUIExtension> <CommandUIDefinitions> <CommandUIDefinition Location="Ribbon.EditingTools.CPEditTab.Clipboard.Controls._children"> <Button Id="Open template" Alt="Open template" Sequence="100" Command="CustomRibbonButton_CopyHtml_Command" Image16by16="/_layouts/images/NoteBoard_16x16.png" Image32by32="/_layouts/images/NoteBoard_32x32.png" LabelText="Open template" TemplateAlias="o1" /> </CommandUIDefinition> </CommandUIDefinitions> <CommandUIHandlers> <CommandUIHandler Command="CustomRibbonButton_CopyHtml_Command" CommandAction="javascript:openDialog('/SitePages/Template.aspx');" /> </CommandUIHandlers> </CommandUIExtension> </CustomAction> <CustomAction ScriptSrc="scripts/script.js" Location="ScriptLink" Sequence="100"> </CustomAction> <Module Name="CustomRibbonActionModule"> </Module> </Elements>
Не связан с sharepoint.stackexchange