• sharepoint ribbon添加菜单


        <CustomAction
          Id="Ribbon.WebPartPage.CustomGroup"
          Location="CommandUI.Ribbon">        
            <CommandUIExtension>
                <CommandUIDefinitions>
                    <CommandUIDefinition
                      Location="Ribbon.WebPartPage.Groups._children">
                        <Group
                          Id="Ribbon.WebPartPage.CustomGroup"
                          Sequence="55"
                          Description="des"
                          Title="custom group"          
                           Command="CustomGroup"
                          Template="Ribbon.Templates.Flexible2">
                            
                            <Controls Id="Ribbon.WebPartPage.CustomGroup.Controls">
                                <Button
                                  Id="Ribbon.WebPartPage.CustomGroup.CustomGroupTemplate"
                                  Command="CustomGroupSelectTemplate"
                                  Image16by16="/_layouts/images/visualupgradehh.png"
                                  Image32by32="/_layouts/images/visualupgradehh.png"
                                  LabelText="选择模版"                               
                                  TemplateAlias="o2"
                                  Sequence="15" />
                                
                                <Button
                                  Id="Ribbon.WebPartPage.CustomGroup.CustomGroupSkin"
                                  Command="CustomGroupSelectSkin"
                                  Image16by16="/_layouts/images/visualupgradehh.png"
                                  Image32by32="/_layouts/images/visualupgradehh.png"
                                  LabelText="选择皮肤"
                                  TemplateAlias="o2"
                                  Sequence="18" />
                                <Button
                                  Id="Ribbon.WebPartPage.CustomGroup.CustomGroupCMS"
                                  Command="CustomGroupCMS"
                                  Image16by16="/_layouts/images/visualupgradehh.png"
                                  Image32by32="/_layouts/images/visualupgradehh.png"
                                  LabelText="内容管理"
                                  TemplateAlias="o2"
                                  Sequence="21" />
                            </Controls>
                        </Group>
                    </CommandUIDefinition>
                    <CommandUIDefinition
                      Location="Ribbon.WebPartPage.Scaling._children">
                        <MaxSize
                          Id="Ribbon.WebPartPage.Scaling.CustomGroup.MaxSize"
                          Sequence="15"
                          GroupId="Ribbon.WebPartPage.CustomGroup"
                          Size="LargeLarge" />
                    </CommandUIDefinition>
                </CommandUIDefinitions>
                <CommandUIHandlers>
                    <CommandUIHandler
                      Command="CustomGroup"
                      CommandAction="javascript:return true;" />
                    <CommandUIHandler
                      Command="CustomGroupSelectTemplate"
                      CommandAction="javascript:alert('Hello, world!');" />
                    <CommandUIHandler
                      Command="CustomGroupSelectSkin"
                      CommandAction="javascript:alert('Good-bye, world!');" />
                    <CommandUIHandler
                      Command="CustomGroupCMS"
                      CommandAction="javascript:alert('cms, world!');" />
                </CommandUIHandlers>
            </CommandUIExtension>
        </CustomAction>

    1、此按钮添加到“页面” tab页;

    2、需要编辑页面才能看到效果;

    3、javascript执行不来,不知道怎么回事;

    最后改用urlaction

        <CustomAction
      Id="SelectTemplate"
      GroupId="SiteActions"
      Location="Microsoft.SharePoint.StandardMenu"
      Sequence="1000"
       Title="自定义" Description=描述"
      ImageUrl="/_layouts/images/visualupgradehh.png"
       Rights="ManagePermissions">
            <UrlAction Url="~site/_layouts/settings.aspx"/>
        </CustomAction>
  • 相关阅读:
    Button 使用Command 按钮置灰未更新
    C# TextBox 焦点
    MultiTigger 绑定异常处理
    C# 获取程序路径
    Linux 权限设置chmod
    WPF SpreadSheetGear电子表单
    WPF 窗口
    Excel公式 提取文件路径后缀
    C#/VB.NET 获取电脑属性(硬盘ID、硬盘容量、Cpu序列号、MAC地址、系统类型)
    DevExpress Carousel 设置水平滑动列表
  • 原文地址:https://www.cnblogs.com/denglinhai/p/2662735.html
Copyright © 2020-2023  润新知