5

I'm trying to deactivate/remove/uninstall a default Client Side Web-Part (the Yammer one) in modern pages and I don't find a way to do it:

enter image description here

I would like the Yammer option to be not visible in the menu. Any ideas?

Thank you very much in advance!

2

I dont think so there is any way to remove those OOTB shipped client side web parts. But as a workaround you can inject custom CSS to your page using SPFx Extensions - Application Customizer (still in preview so workaround doesnt apply to production tenant) to hide the element from the page.

The yammer webpart render as button having following code. Use the css selector to hide it.

<button class="CanvasToolboxItem CanvasToolboxItemFloat" title="Display Yammer conversations." data-automation-id="YammerEmbedWebPartToolboxItem" tabindex="0" style="">
    <i role="presentation" aria-hidden="true" data-icon-name="YammerLogo" class="ms-Icon css-liugll CanvasToolboxItem-icon"></i>
    <div data-automation-id="less-text" title="Yammer feed" class="CanvasToolboxItem-title">Yammer feed</div>
</button>
  • Thanks a lot for the answer. Yes, we already thought about this workaround, but as the SPFx Extensions are not in GA status, we don't want to use it. – Txemanu Sep 13 '17 at 10:37
  • As a trick, your custom client side web part can also inject script on modern page but even i wont recommend that way, using Extensions will be the preferred way but since we know its in RC mode right now, we cant implement it for production tenants as of now. You may have to wait for couples of weeks to get GA of Extensions. – ThinkB4Code Sep 13 '17 at 10:52
  • Hi again, as SPFx Extensions are now in GA status, I did it using CSS selectors: button[data-automation-id="YammerEmbedWebPartToolboxItem"] { display: none; } Many thanks! – Txemanu Sep 29 '17 at 8:59
0

Specifying the Client-Side Web Part icon using a font icon Another way to set the icon of a Client-Side Web Part is by specifying the name of the font icon using the officeFabricIconFontName. Example this code "Sunny", make a filter for the necessary widgets code:

{
  "$schema": "../../../node_modules/@microsoft/sp-module-interfaces/lib/manifestSchemas/jsonSchemas/clientSideComponentManifestSchema.json",

"id": "e71c23c5-4ddb-40b6-9e52-d292a4d8300b", "componentType": "WebPart", "version": "0.0.1", "manifestVersion": 2,

"preconfiguredEntries": [{ "groupId": "e71c23c5-4ddb-40b6-9e52-d292a4d8300b", "group": { "default": "Default" }, "title": { "default": "Weather" }, "description": { "default": "Shows weather in the given location" }, "officeFabricIconFontName": "Sunny", "properties": { "location": "" } }] }

enter image description here

Despite its name, the officeFabricIconFontName property doesn't support all icons listed at Office UI Fabric. Here is the list of all icons that you can use with the officeFabricIconFontName property.

  • 2
    What does this have to do with removing things from the menu? – Matti Virkkunen Sep 12 '17 at 14:14
  • @Mikhail Zhuykov: He wants to remove it not change an icon of a custom client webpart – Sebastian Schütze Sep 13 '17 at 8:47
  • @SebastianSchütze I already added this solution, it also did not suit, all just a person does not know what he wants c-sharpcorner.com/article/… – user37251 Sep 13 '17 at 9:50
  • @MikhailZhuykov please read his question again. He is not talking about custom SPFx webpart but the default one. You can't remove them like you suggest with the link! – Sebastian Schütze Sep 13 '17 at 18:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.