Search code examples
tridiontridion-2011tridion2009

iframe tag in component gives incomplete page on publishing


In Tridion I have a page to which a component is attached that has a text field in which, there is a iframe tag like <iframe src="http://mysite.com/l/5042/2012-06-21/9pb4y" width="100%" height="500" frameborder="0" style="border: 0" > </iframe>. I ensure that this tag remains as it is while being processed by C# & DWT template building blocks. But at the end when the page is published, in the source of the page, the tag changes to <iframe src="http://mysite.com/l/5042/2012-06-21/9pb4y" width="100%" height="500" frameborder="0" style="border: 0" />. Due to this the page source does not show any content after the iframe tag. So any component that is attached to the page after the component containing iframe tag does not show up on page. Any idea why the closing tag </iframe> is replaced by self closing tag />?


Solution

  • As Frank mentioned you could use the Convert XML to HTML TBB

    (OR)
    

    You could also consider the solution from Chris provided in this thread. Creating anchor links in rich text fields with SDL Tridion 2011 SP1

    You apply xslt for the schema field definition. While the TBB option applies to the full CT/PT depending on where you use it, but with XSLT you can use it at the field level and also gets the same format when you use the CoreService for any other use cases.