Yes, you have to make sure, that the data in the container not is empty, otherwise the html unfortunately is self-closing and it might break the layout..
There are multiple ways to fix this.. e.g as you mention with inserting a <xsl:comment /> or you can force an empty space <xsl:text> </xsl:text> ... or you can change output to html:
Fixed: Youtube embed through XSLT
Just spent the last hour to figure out why my "embed-youtube" xslt was breaking my page layout (hiding all HTML that came after the video embed code).
Then finally it struck me that it was because there was no data between the iframe start and end tag and xslt does not seem to like that :/
So with a little work around i got i working:
$currentPage/frontpageMedia is a Singleline text field where the key for the youtube video is pasted into.
I.E: PbK9eybE35E
Hope it can help someone in a similar situation.
Have a nice day :-)
Umbraco version 4.7.2
Yes, you have to make sure, that the data in the container not is empty, otherwise the html unfortunately is self-closing and it might break the layout..
There are multiple ways to fix this.. e.g as you mention with inserting a <xsl:comment /> or you can force an empty space <xsl:text> </xsl:text> ... or you can change output to html:
<xsl:outputmethod="html"omit-xml-declaration="yes"/>
http://our.umbraco.org/wiki/how-tos/xslt-useful-tips-and-snippets/stop-html-tags-from-self-closing
/Bjarne
Thanks for the xsl positing you did with youtube example, it was pretty useful. Thanks a ton :)
is working on a reply...