在新功能区中更改Sharepoint图标

问题描述 投票:0回答:1

我试图在我的项目服务器网站中添加一个功能区,它正在工作但我正在寻找一种方法来更改我的图标

这里是我使用的代码:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction Id="d6e0a4c1-19a9-4846-92fb-d0593aa3bbfc.myAppNewFormAction"
                RegistrationType="List"
                RegistrationId="115"
                Location="CommandUI.Ribbon"
                Sequence="10001"
                Title="New myApp Form">
    <CommandUIExtension>
      <!-- 
      Update the UI definitions below with the controls and the command actions
      that you want to enable for the custom action.
      -->
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.Documents.New.Controls._children">
          <Button Id="Ribbon.Documents.New.myAppNewFormActionButton"
                  Alt="New myApp Form"
                  Sequence="100"
                  Command="Invoke_myAppNewFormActionButtonRequest"
                  LabelText="New myApp Form"
                  TemplateAlias="o1"
                  Image32by32="Mysite/Pwa/ImageFolders/myAppLogoBug-onwhite-32.png"
                  Image16by16="Mysite/Pwa/ImageFolders/myAppLogoBug-onwhite-16.png" />
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler Command="Invoke_myAppNewFormActionButtonRequest"
                          CommandAction="~appWebUrl/Pages/Default.aspx?Action=New&amp;Source={Source}&amp;ListURLDir={ListUrlDir}"/>
      </CommandUIHandlers>
    </CommandUIExtension >
  </CustomAction>
</Elements>

所以在我的项目服务器上;我创建了一个列表,我在其中存储了我的图像,但它没有工作,图标显示我是一个空案例

我也尝试在base 64中转换我的图像,但结果是一样的:/

我知道我做错了什么?

sharepoint ribbon
1个回答
0
投票

我的测试演示供您参考。

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction Id="cfe1a724-53ea-4a66-acda-7bc69c2fff1c.CustomRibbonImage"
                RegistrationType="List"
                RegistrationId="{$ListId:OOBDoc;}"
                Location="CommandUI.Ribbon"
                Sequence="10001"
                Title="Invoke &apos;CustomRibbonImage&apos; action">
    <CommandUIExtension>
      <!-- 
      Update the UI definitions below with the controls and the command actions
      that you want to enable for the custom action.
      -->
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.Documents.New.Controls._children">
          <Button Id="Ribbon.Documents.New.CustomRibbonImageButton"
                  Alt="Request CustomRibbonImage"
                  Sequence="100"
                  Command="Invoke_CustomRibbonImageButtonRequest"
                  LabelText="Request CustomRibbonImage"
                  TemplateAlias="o1"
                  Image32by32="~sitecollection/SiteAssets/test.png"
                  Image16by16="~sitecollection/SiteAssets/test.png" />
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler Command="Invoke_CustomRibbonImageButtonRequest"
                          CommandAction="~appWebUrl/Pages/Default.aspx?{StandardTokens}&amp;SPListItemId={SelectedItemId}&amp;SPListId={SelectedListId}"/>
      </CommandUIHandlers>
    </CommandUIExtension >
  </CustomAction>
</Elements>

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.