Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Shaun 248 posts 475 karma points
    May 10, 2011 @ 12:11
    Shaun
    0

    xslt generating tilde "~" in replaced url

    Hi all.

    I'm having to parse some RTE entered content and amend any references to media paths to include the entire site path

    <xsl:value-of select="umbraco.library:Replace(bodyText, '/media/', 'http://www.mysite.com/media/')" disable-output-escaping="yes" />
                

    however, for some reason its adding a tilde at the start when rendering, so I get

    <img src="~http://www.mysite.com/media/blahblah.jpg" />

    and no images appearing.

    I'm guessing I could output my content to a variable, then just strip any tilde's from the variable before displaying it, but does anyone know why Umbraco is doing this, and any way it can be overridden?

    Cheers

    Shaun

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    May 10, 2011 @ 12:37
    Chriztian Steinmeier
    1

    Hi Shaun,

    I think the tilde is there all the time (in content from the WYSIWYG) - you're just replacing around it, so to speak - why not include it in the replace?

    <xsl:value-of select="umbraco.library:Replace(bodyText, '~/media/', 'http://www.mysite.com/media/')" disable-output-escaping="yes" />

    /Chriztian

  • Shaun 248 posts 475 karma points
    May 10, 2011 @ 12:50
    Shaun
    0

    aah. I couldn 't see the tilde in the WYSIWYG html, so had assumed it was something generated by the xslt itself.

    I've included it in the replace and its working brilliantly.

    Cheers Chriztian.

Please Sign in or register to post replies

Write your reply to:

Draft