Allow script tags in content item
Is there a way to configure the content item to allow <script> tags? Right now, they're being stripped.
Hi Suzanne,
Implementing scripts in the Html field is disabled by default. Today we use a variety of Content Filters which you can see here:
demos.telerik.com/.../defaultcs.aspx
As you can see, in your case you will have to disable is the RemoveScripts filter.
First you will have to map your editor template ( you need to map a custom template over default one ) in Sitefinity and then specify which Content Filters should be enabled. Create your editor template and register it in Sitefinity by going to Settings > Advanced > Controls > ViewMap > Telerik.Sitefinity.Modules.GenericContent.Web.UI.ContentBlockDesigner. In LayoutTemplatePath field enter the path to your template( ~/Templates/Editor.ascx ).
Please refer to this forum thread where my colleague Boyan gave some more information about the way you can achieve that ( in addition to this answer here ).
You can paste the following code between <div>, </div> tags of your editor .ascx file:
<
sf:HtmlField
ID
=
"htmlEditor"
runat
=
"server"
Width
=
"99%"
Height
=
"370px"
EditorContentFilters
=
"DefaultScripts"
<%--replace with needed filters--%>
EditorStripFormattingOptions="MSWord,Css,Font,Span,ConvertWordLists"
DisplayMode="Write"
FixCursorIssue="True">
</
sf:HtmlField
>