none
I want hide the New Promote PageDetails in SharePoint modern page RRS feed

  • Question

  • I want to hide the below things marked in red color in SharePoint modern page by using powerShell script for all the pages under site pages library

    Monday, December 9, 2019 3:47 PM

All replies

  • Hi Rajesh Kumar V S N K,

    May i know more details about this issue? we did not see anything in red color, maybe there is a pic lost. 

    Thanks 

    Baker Kong


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click  here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Tuesday, December 10, 2019 2:55 AM
  • Tuesday, December 10, 2019 3:48 AM
  • Hi !!

    you could hide this items with extensions in SPFx, applying Jquery.

    https://docs.microsoft.com/en-us/sharepoint/dev/spfx/extensions/overview-extensions

    I believe the only items than you could hide are the options PowerApps and Flow with Powershell

    Tuesday, December 10, 2019 3:58 AM
  • Any examples related to this?
    Tuesday, December 10, 2019 4:00 AM
  • Hi Rajesh Kumar V S N K,

    Here i followed this tutorial and it could hide those commander bars. 

    CSS :

    div.ms-CommandBar-primaryCommand[role='presentation']>div{
    	visibility:hidden;
    }

    main code:

    @override
      public onInit(): Promise<void> {
        Log.info(LOG_SOURCE, `Initialized ${strings.Title}`);
        const head: any = document.getElementsByTagName("head")[0] || document.documentElement;
        let cssUrl = '/sites/{css file location}/Style%20Library/custom.css';
        let customStyle: HTMLLinkElement = document.createElement("link");
        customStyle.href = cssUrl;
        customStyle.rel = "stylesheet";
        customStyle.type = "text/css";
        head.insertAdjacentElement("beforeEnd", customStyle);
    
        return Promise.resolve();
    }

    Best Regards,

    Baker Kong


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click  here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Wednesday, December 11, 2019 5:29 AM
  • I want to show sendbyemail & published on date also as visible what are the changes i need to do?
    Wednesday, December 11, 2019 5:39 AM
  • Hi Rajesh Kumar V S N K,

    Please have a try the following CSS:


    Best Regards,

    Baker Kong


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click  here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.




    Wednesday, December 11, 2019 6:34 AM
  • i try this but showing as below.

    I want to hide promote and page details also

    Wednesday, December 11, 2019 6:57 AM
  • At the time of pageload its not applying the CSS if do ctrl F5 then only its applying the style.

    How can we apply the style before the page loads?

    Wednesday, December 11, 2019 8:33 AM
  • Hi Rajesh Kumar V S N K,

    The mentioned buttons were added into the command panel from a partial update on the page, which means they're generated after page load. It's not possible to access those elements from client-side code before page load. 

    Best Regards,
    Baker Kong

    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click  here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Wednesday, December 11, 2019 9:39 AM
  • But its not reflecting without doing ctrlF5

    Any possibility it should work without doing ctrlF5

    Wednesday, December 11, 2019 10:02 AM
  • Hi Rajesh Kumar V S N K,

    SharePoint modern page will store cache for a fast experience. When we test this extension, we may need to refresh the page with cache clearing to reflect the customization. For general usage, we believe the style will be applied immediately when the page loads. 

    Best Regards,

    Baker Kong


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click  here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Thursday, December 12, 2019 1:31 AM