Sharepoint online add a notication message at top banner in the site

Hemanth kumar 1 Reputation point
2020-08-06T10:40:13.827+00:00

I want to display a alert message to users at the top of the site before site migration in SP online. In SP 2016 i have implemented using powershell usercustom actions that is working fine and i did the same in online, but here it is not working. Below attached the working version of SP 2016 image. Please suggest any solutions or approach.

16161-custom-action-to-add-top-banner-message-in-sharepo.png

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,217 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,607 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,573 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Anupam Shrivastava 176 Reputation points
    2020-08-06T13:50:00.557+00:00

    So, I understand you want to show such a message in SharePoint Online. One way could be go custom and implement a SPFx based solution. But if you just want users to not to add any content in such SPO sites, you can make them read only. Take a look at this article about HOW TO MAKE SHAREPOINT ONLINE SITE COLLECTION READ ONLY

    1 person found this answer helpful.
    0 comments No comments

  2. Baker Kong-MSFT 3,791 Reputation points
    2020-08-07T05:30:38.363+00:00

    Hi Hemanthkumar-8346,

    Modern experience does not support custom actions. This is a limitation (or as designed) by the modern experience. You can continue using script link action in classical UI.

    These customizations are currently not supported

    Per the doc suggestion, the recommendation is to use SPFx extension. We can inject some JS/CSS script into SPFx extension.

    Check Step By Step Procedure To Add A JS File To All Pages In A SPFx Modern Pages Using SharePoint Framework Extension

    Below is my test demo:

    And the related JS is:

    This js file was stored under /Style Library.

    Test Result:

    16286-image.png

    Best Regards,
    Baker Kong

    0 comments No comments

  3. Baker Kong-MSFT 3,791 Reputation points
    2020-08-11T04:35:10.103+00:00

    Hi @Hemanth kumar ,

    Regarding this issue, we have not heard from you for some time. Does it get resolved? If the above info is helpful to this question, it would be appreciated if you can mark it as an answer so that others who stuck in similar issues could get answered quickly.

    Thanks
    Baker Kong