Open VesaJuvonen opened 7 years ago
We'll need to investigate this one.
For now a good way to circumvent this issue is to use the HTML Number (~
) instead of the tilde, the parser doesn't pick it up but once it's deployed SharePoint does replace it and the jslink works again.
However, it requires manual replacement in the XML which is not a good thing if you're doing the creation of template and site all automatically in one go. You could add a handler which does this replacing for you in specific instances, before you provision the new site, if this is an issue for you.
The workaround proposed by @justdevelopment does indeed work. Flagging this one as bug to build a better solution.
This work around doesn't appear to work. Is there another work around? I've tried different combinations of using CDATA and parameters with not luck.
From @johannes-z on December 25, 2016 3:16
System: Sharepoint Online
When creating a new subsite from a template, whereas the template has web parts with jslink in it, sharepoint automatically resolves any URL tokens used (e.g.
~sitecollection
) for the newly created site. This breaks the jslink effectively because the URLs don't work if they are relatively specified (e.g./sites/sitecol/...
.Is there a way to either prevent this from happening or to change it after it has happened? Because the creation is user trigger CSOM/JSON can't be used.
Any ideas?
Copied from original issue: SharePoint/PnP#1577