Copied to clipboard

Flag this post as spam?

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


  • Kim Andersen 1447 posts 2197 karma points MVP
    Oct 05, 2009 @ 15:17
    Kim Andersen
    0

    Images inserted in the Richtext Editor isn't visible in Hotmail

    When an image is inserted in the Richtext Editor, the path to the image will be something like "/media/276/image.jpg". But I am making a newsletter, where content from the RTE is inserted. This means that if an image is inserted, and the newsletter is sent to some different e-mails, the images from the RTE is not always displayed.

     

    Actually both Gmail and Yahoo shows the images, but Hotmail can't fint the image. Yahoo and Gmail can figure the TLD out by the self. So a path to an image in Gmail and Yahoo will be: http://mydomain.com/media/276/image.jpg but in Hotmail it will be: "http:///media/276/image.jpg".

     

    Does anyone have an idea, how to get arround this problem?

  • Stephan Lonntorp 195 posts 212 karma points
    Oct 05, 2009 @ 15:25
    Stephan Lonntorp
    0

    You could always write out the TLD manually, bu doing a string replace in XSLT and replace '/media/' with 'http://mytld.com/media/', or automate it by using umbraco.library:RequestServerVariables('HTTP_HOST').

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Oct 05, 2009 @ 15:30
    Douglas Robar
    0

    This post is related, and gives a few ideas how you might solve it.

    cheers,
    doug.

  • dandrayne 1138 posts 2262 karma points
    Oct 05, 2009 @ 16:00
  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Oct 05, 2009 @ 16:12
    Douglas Robar
    0

    Thanks for looking out for me, Dan! That was the link I meant to include.

    cheers,
    doug.

  • Kim Andersen 1447 posts 2197 karma points MVP
    Oct 05, 2009 @ 18:07
    Kim Andersen
    0

    Thanks Douglas and Dan.

     

    I'll try the method out. But just a follow question to the method.

     

    How do I use it when I write out my content-field? Right now it is written out like this:

    <xsl:value-of select="$itm/data[@alias='content']" disable-output-escaping="yes" />

     

    But is it possible to hook into the content-field or how? Thank you very much for your patience and help.

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Oct 05, 2009 @ 18:18
    Douglas Robar
    0

    Using the code I showed in the other forum post, you would replace

    <xsl:value-of select="$item/data[@alias='content']" disable-output-escaping="yes" />

    with

    <xsl:call-template name="fullUrls">
    <xsl:with-param name="content" select="$item/data[@alias='content']" />
    </xsl:call-template>

     

    cheers,
    doug.

  • Kim Andersen 1447 posts 2197 karma points MVP
    Oct 07, 2009 @ 09:38
    Kim Andersen
    0

    You are the man Doug!

     

    I have used your code from the other post. Just changed it a small bit, because there where some white space in my src, and hotmail still couldn't understand that.

    This is maybe because I haven't hardcoded the full URL, but uses the SERVER_NAME. This means that I can use it on other domains as well in the future. So my template looks like this now:

    <xsl:template name="fullUrls">
    <xsl:param name="content" />

    <xsl:variable name="srcPattern">
    <xsl:text>src="/</xsl:text>
    </xsl:variable>
    <xsl:variable name="srcReplacePattern" select="concat('src=&quot;http://', umbraco.library:RequestServerVariables('SERVER_NAME'), '/')" />

    <xsl:variable name="step1" select="umbraco.library:Replace($content, $srcPattern, $srcReplacePattern)"/>
    <xsl:value-of select="$step1" disable-output-escaping="yes"/>
    </xsl:template>

    But thanks a lot for your help Doug :)

  • 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.

Please Sign in or register to post replies