I use the Simple Editor to write content, which can be used in Google Maps info window..
I store the content in a variable in the template and use that variable in my javascript code.. but the problem is that even if I convert linebreaks with <br /> it still break the line in the source code, which break the javascript code..
Simple editor - content without linebreaks
Hi..
I use the Simple Editor to write content, which can be used in Google Maps info window..
I store the content in a variable in the template and use that variable in my javascript code.. but the problem is that even if I convert linebreaks with <br /> it still break the line in the source code, which break the javascript code..
Content in Simple editor:
<p>Address<br/>Zip City<br/>Tlf: 12 34 56 78<br/><a href="mailto:mail@mail.com">mail@mail.com</a>
</p>
In template:
When I don't use any linebreaks in the editor it works..
Is the a way to force the content always to display in one line/a string?
/Bjarne
Okay.. I moved the variables to a xslt files.. and use normalize-space to remove the linebreaks after I read this post: http://our.umbraco.org/forum/developers/xslt/29290-Remove-line-breaks-for-locator-package
<xsl:variable name="mapVariable" select="$currentPage/ancestor-or-self::Lang" /> <xsl:text disable-output-escaping="yes"> <script type="text/javascript"> </xsl:text> var getDrivingDirections = '<xsl:value-of select="umbraco.library:GetDictionaryItem('gmGetDrivingDirections')" disable-output-escaping="yes"/>'; var mapInfoWindowTitle = '<xsl:value-of select="umbraco.library:Replace(normalize-space($mapVariable/googleMapsInfoWindowTitle), '
', '\n')" disable-output-escaping="yes"/>'; var mapInfoWindowDesc = '<xsl:value-of select="umbraco.library:Replace(normalize-space($mapVariable/googleMapsInfoWindowDesc), '
', '')" disable-output-escaping="yes"/>'; <xsl:text disable-output-escaping="yes"> </script> </xsl:text>/Bjarne
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.