RadEditor Moving Article HTML5 tag
Hi -
Within SF 7, we have a content block that looks like:
<
div
> <
input
type
=
"radio"
name
=
"accordion-1"
id
=
"ac-2"
> <
label
for
=
"ac-2"
>operate a shared use lock</
label
> <
article
class
=
"ac-larges"
> <
p
><
iframe
width
=
"100%"
height
=
"400"
frameborder
=
"0"
align
=
"middle"
src
=
"http://www.test.com/index.html"
scrolling
=
"no"
></
iframe
></
p
> </
article
> </
div
>
It works the first time you save the RadEditor window. However, when you go back in, the closing article tag is moved right behind the opening article tag like this:
<
div
> <
input
type
=
"radio"
name
=
"accordion-1"
id
=
"ac-2"
> <
label
for
=
"ac-2"
>operate a shared use lock</
label
> <
article
class
=
"ac-larges"
> </
article
> <
p
><
iframe
width
=
"100%"
height
=
"400"
frameborder
=
"0"
align
=
"middle"
src
=
"http://www.test.com/index.html"
scrolling
=
"no"
></
iframe
></
p
> </
div
>
How can we prevent RadEditor from moving this code? It breaks our content every time?
Thanks,
Greg
Hello Greg,
The issue that you mentioned is caused because this is the default behavior of the RadEditor. The RadEditor by default modifies the content of the HTML5 tags in order to keep the support of the old browsers. If you want to prevent this behavior you can try the following:
1) Download the attached files, extract the archive and add the files inside your SitefinityWebApp project
2) Go to your site’s Administration > Settings > Advanced page and open the Controls > ViewMap node. Create a new entry and for the HostType, enter Telerik.Sitefinity.Web.UI.Fields.HtmlField. Then enter the path to your custom template file in the LayoutTemplatePath property.
If you need any additional information on this matter please do not hesitate to ask
Thank you Elena, this fixed the issue for us mostly, however, if we use the rad editor's code snippet drop down (toolsfile.xml) to drop some HTML into the page and that HTML has an HTML5 element in it, it sill will move the closing tag to right after the opening tag. If you manually correct it, then the rad editor doesn't move your tag again, but is there a way to prevent this from happening when initially dropping in HTML from the code snippet drop down? Thanks!!