Closed andreasblueher closed 6 years ago
A few things to test out here:
Could you please provider SharePoint version (13/16) and API used (CSOM/SSOM) - will test to see if this scenario even works.
As for supported scenarios and adding web part to a wiki page, we have the following one covered: CanDeploy_ScriptEditorTo_WikiPageContent_As_AddToPageContent
Web part provision to a wiki page is rather a tricky one. SharePoint has got a special zone ID "wpz", and then adds everything to the wiki page content (similar to publishing pages) with super-special web part ID mapping. We have tons of magic underneath to get it more or less stable and repeatable but it won't be a wonder that it fails on some cases.
If other means to deliver this JavaScript on the page can be considered - that might be a more stable solution at the end. Meanwhile, more than happy to troubleshoot this case and make it working as much as we can.
Hey guys,
WebpartScenariosTest.cs helped me a lot. I managed to deployed the WikiPage, the ScriptEditor and add the JavaScript automatically. It works like a charm.
I've thought about what piece of my code I could share to make this issue more useful to other people, but your scenario should help everyone.
Hey,
I've tried a couple of different things to deploy a WikiPage to my SitePages library with JavaScript code on it.
or empty WikiPageDefinition with ScriptEditorWebpar
Neither of those options results in a working script. When trying the 2nd option I even got an exception when accessing the application page:
I couldn't find any references regarding this exception, so I have no clue what the real issue is.
Currently I deploy the application using SPMeta2 and add the JavaScript code later on by using "Embed code" via UI.