Is there a way to add a content editor web part to a modern page?

Deleted
Not applicable

I know that you can create a web part page in the Site Pages library, I'm just wondering if there's a way to make it available on a modern page. It seems odd to me that Microsoft got rid of that web part... AND the script editor web part, both of which are highly used web parts. What is the reason for that?

4 Replies
Don't have the answer for why, but they are eventually bringing that functionality possibly in future web part releases. However, it's fairly easy to create your own webparts to do alot of that functionality with the current spfx webparts without having to invest alot.
No, you can use your custom SPFx WebParts in classic pages but the other way around is not possible: you cannot use classic SPO WebParts in modern SPO pages. There is a WebPart created by Mikael Svenson that could help you here: https://github.com/SharePoint/sp-dev-fx-webparts/tree/master/samples/react-script-editor

If you take ALM in account this webpart would probably be better because you can manage your own sources seperately as seperate files and not embeded in another webpart.

Read this: https://info.paitgroup.com/blog/perhaps-the-only-other-sharepoint-framework-web-part-you-will-ever-n..., and the link to the github repository:  https://github.com/rob-windsor/ContentEditorSpfx

 

This webpart uses SPFx 1.0 but you can easily upgrade this solution to SPFx 1.5.1 (latest version while writing) so you can make use of the 'skipFeatureDeployment' parameter which will allow you to scope this App Package tenant wide.