有没有人跑进SiteCore从页面编辑器中删除JavaScript? [英] Has anyone run into SiteCore removing JavaScript from the page editor?
问题描述
我已经在SiteCore的一个自定义页面上做假期,我注意到一个问题,SiteCore从编辑器中删除JavaScript行。
I've been working on a custom page in SiteCore over the holidays, and I've noticed an issue where SiteCore removes JavaScript lines from the editor.
这里
- 我添加了Javascript到页面。
- 更改已经存在,一切正常。
- 我稍后处理,这些更改不再存在。
- I add Javascript to the page.
- I save, check in, and publish.
- Changes are there, and everything is working.
- I work on it later and those changes are no longer there.
我是唯一编辑此页面的人,它正在发布当前/正确的版本。如果我通过内容编辑器的显示编辑器或编辑HTML功能添加脚本没有关系。它只是删除了JavaScript;我所有的其他更改是完整的。
I'm the only one who's edited this page, and it is publishing the current/correct version. It doesn't matter if I add the script through the "Show Editor" or "Edit HTML" features of the content editor. It only removes the JavaScript though; all of my other changes are intact.
有没有什么我不知道SiteCore的JavaScript实现?我不知道为了诊断它还要做什么,所以我希望有人能对此做出解释。
Is there something that I'm missing about SiteCore's implementation of JavaScript? I'm not sure what else to do in order to diagnose it, so I was hoping someone here would have an explanation for this.
推荐答案
在保存项目时,删除Sitecore中的RTE中的脚本标记是标准行为。
然而,在Sitecore 6.4.1 rev。 120113和Sitecore 6.5 Update-4在web.config中添加了一个新属性:
Removing the script-tags in the RTE in Sitecore is standard behavior when the item is saved. However, in Sitecore 6.4.1 rev. 120113 and Sitecore 6.5 Update-4 there is a new property added in the web.config:
<setting name="HtmlEditor.RemoveScripts" value="true"/>
将此值设置为false应该可以解决您的问题。
如果您使用的是旧版本的Sitecore,请查看此博客,其中显示了旧版本的解决方法。
Setting this value to false should solve your problem. If you are using an older version of Sitecore, take a look at this blogpost which shows a workaround for older versions.
这篇关于有没有人跑进SiteCore从页面编辑器中删除JavaScript?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!