Forum Discussion

Khushi Shaikh's avatar
Khushi Shaikh
Brass Contributor
Dec 22, 2020

Script Editor in modern site

Hello SharePoint Gurus - I am working on Modern Site and need to inject some CSS/HTML to calendar page. Trying to preserve left navigation links when user switch from one overlay calendar to another. I couldn't see script editor web part. How can I inject CSS/HTML on calendar page? Is SPFX development only way to do custom development in modern site? 

 

Thanks & Regards,

Khushi

3 Replies

  • Khushi Shaikh Script Editors do not work because custom scripting is turned off. SPFx is the way. However, I would like to note, the calendar page is a classic page, so while this customization is unlikely to break...  be aware, if you develop modern pages in the future, injecting code via script editors to change out of the box components isn't supported. With great power, comes great responsibility.

    Here is a modern script editor built in SPFx by the community. 
    https://github.com/pnp/sp-dev-fx-webparts/tree/master/samples/react-script-editor

    • Khushi Shaikh's avatar
      Khushi Shaikh
      Brass Contributor

      Thanks for the link Beau Cameron I am looking to do things in right way. After looking at Github's SPFX Script Editor, it seems is not a correct way to do it. Is there any way as per the best practices to edit the calendar page to edit the HTML using SPFX?

       

      Best Regards,

      Khushi 

Resources