2

We add some customize HTML JavaScript Tag to reference external JS resource, it looks like this:

<script src="http://edge.quantserve.com/quant.js"></script>

But each time Tridion will short it to:

<script src="http://edge.quantserve.com/quant.js" />

Which is not a correct format. Does anyone know how to stop this action? Thanks!

Best regards, Chen Qiang

2 Answers 2

3

This is a common scenario. The same question had been asked and answered on Stack Overflow here: https://stackoverflow.com/questions/12954444/adding-self-closing-tags-in-rtf-field

You can also workaround the problem by simply throwing an html comment or some "syntactic sugar" inside the tags so that it stops being self closing.

3

Nick's answer is correct, in that if you are using a Rich Text field for this, the data will be processed via XML. A better solution, though, would be to avoid using a Rich Text field. It's quite common to simply use a "code component" (with a plain text field) for HTML head items, and to emit the code on to the page untransformed.

Your Answer

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

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