Forum Discussion
Code snippet web part
- Feb 06, 2019
As others have mentioned, the code snippet web part just displays code, it doesn't execute it.
You should also be aware that trying to override out of the box styles is not good practice. Those IDs are subject to change and they will change as they are dynamically generated.
As others have mentioned, the code snippet web part just displays code, it doesn't execute it.
You should also be aware that trying to override out of the box styles is not good practice. Those IDs are subject to change and they will change as they are dynamically generated.
- JMU Cloud ShareMar 11, 2019Copper Contributor
Will the code snippet web part actually work at some point? I don't see any purpose for a non working code snippet web part.
- Amanda DowningJul 08, 2019Brass Contributor
From my perspective the Code Snippet web part does work. It allows you to share pieces of code. It isn't meant to act as a window to run code, but a means of sharing pieces of code in a visual manner.
- gerhard91Jul 26, 2023Copper Contributor
Amanda DowningThe main problem for me is, that after publishing the code via the code snippet web part, it cannot be copied (Strg+C) from the sharepoint site. For the browser is looks like a picture.
Does someone have a solution for this?
- RobElliottMar 11, 2019Silver Contributor
Probably not, Microsoft do not want people to be making code changes to sites as they will inevitably break when a future update comes along (which seems to happen every other day at the moment).
Rob
Los Gallardos- Frank NielsenMar 12, 2019Copper Contributor
Hi Rob. I can see it from there point of view. I have earlier worked in a software company that had a very open product, so the customers could make a lot of local changes. But every time we made an upgrade of the product, the customers got a lot of errors in their custom solutions. And we were the one to blaime :-/
Frank
- Frank NielsenFeb 07, 2019Copper Contributor
Thank you so much for quick reply. Last night i did find a script editor webpart for modern pages on GitHub, and will take a look at that instead. It is not some great changes I want to make, so I will give it a try.
https://github.com/SharePoint/sp-dev-fx-webparts/tree/master/samples/react-script-editor
Frank
- Frank NielsenFeb 07, 2019Copper Contributor
Thank you so much for quick reply. Last night i did find a script editor webpart for modern pages on GitHub, and will take a look at that instead. It is not some great changes I want to make, so I will give it a try.
https://github.com/SharePoint/sp-dev-fx-webparts/tree/master/samples/react-script-editor
Frank