1

Tridion converting HTML param value automatically in RTF field in web 8. For example below tag

<video data-video-id="5247779517001" data-account="1905768940001" data-player="BkjVe1UXg" data-embed="default" data-application-id class="video-js" control style="width: 100%; height: 100%; position: absolute; top: 0px; bottom: 0px; right: 0px; left: 0px;"> 

is getting converted to

<video data-video-id="5247779517001" data-account="1905768940001" data-player="BkjVe1UXg" data-embed="default" data-application-id="" class="video-js" control="" style="width: 100%; height: 100%; position: absolute; top: 0px; bottom: 0px; right: 0px; left: 0px;"> 

Is there any way to ristrict it ?

Thanks for your answer.

Thanks, Ramesh

1
  • 1
    For those that struggle to see the difference... control became control=""
    – Nuno Linhares
    Jan 27, 2017 at 12:09

2 Answers 2

3

Tridion stores content as XML, therefore rich text fields must be valid XML in order for the component to save.

<video src="something" controls>...</video>

is not valid XML, since XML rules mandate that attributes have values, so it's being converted to

<video src="something" controls="">...</video>

Assuming you want controls to be displayed, then you can use HTML:

<video src="something" controls="controls">...</video>

Also it might be worth looking at whether a RTF field is the best place to place a video. Given the video will likely be a list of links to suitable sources, either inside or outside of the CMS, it is probably deserving of its own Schema and templates. That might be preferable to having authors paste HTML into a field?

2

Tridion stores content and metadata as XML. Rich Text fields are stored as XHTML (which is very similar to HTML, but adheres to the XML rules for well-formedness).

One of the XML rules for well-formedness is that attributes must have a value (in quotes), whereas HTML allows attributes without value, such as control.

So: what you observe is the transformation from HTML to XHTML. This transformation always occurs and cannot be avoided. If you don't want to output XHTML, you would have to transform back to HTML in your templates.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.