zoukankan      html  css  js  c++  java
  • 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>
  • 相关阅读:
    读《大道至简—编程的精义》有感
    c++ 指针做为参数和返回值
    c++ 函数
    c++ 分配与释放内存
    c++ 以多维数组的形式访问动态内存
    c++ 动态数组,指针与动态内存分配
    c++ 指针访问数组
    c++ 常量指针
    c++ 指针
    c++ 字符串转换
  • 原文地址:https://www.cnblogs.com/denglinhai/p/2662735.html
Copyright © 2011-2022 走看看