Script Editor in modern site

Occasional Contributor

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,


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.

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 Shaikh Nope. There is no recommended path for that. My personal recommendation is if you need a custom calendar, to build the custom calendar in SPFx. There are some samples in the PnP Samples library.