Dec 22 2020 12:59 PM
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
Dec 23 2020 06:27 AM
@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
Jan 05 2021 03:11 PM
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
Jan 06 2021 06:18 AM
@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. https://github.com/pnp/sp-dev-fx-webparts