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
    Feb 16, 2010 @ 13:30
    Shaun
    0

    Tinymce and IMG SRC

    I have a page in umbraco that when generated is used as the basis for an HTML newsletter. The url is sent off to a newsletter handling system which handles the actual sending of the mails, all I have to do is generate the page.

    Throughout the XSLT for the page I add the root of the site to any images, as in order to appear in the newsletter they need the full url.

    http://www.mywebsite.com/media/1234/mypicture.jpg

    However, there is a tinymce editor which allows the admin to tweak the layout of some introductory text, and they've started putting images in it, bless them.

    Even if they add the full path, when tinymce saves the SRC it reads as

    /media/1234/mypicture.jpg

    I've looked at the threads that comment on configuring tinymce, but can't see anything that relates to this problem. Does anyone have any ideas?

    Thanks

    Shaun

     

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 12x admin c-trib
    Feb 16, 2010 @ 14:10
    Jan Skovgaard
    0

    Hi Shaun

    Try adding <base href="http://www.mywebsite.com"> to the head section of your HTML template for the newsletter.

    Does it help?

    /Jan

  • Shaun 248 posts 475 karma points
    Feb 16, 2010 @ 20:03
    Shaun
    0

    hmm. No joy I'm afraid.

  • dandrayne 1138 posts 2262 karma points
    Feb 16, 2010 @ 20:10
    dandrayne
    0

    Hi there

    If you're using xslt to render tinymce content, perhaps something like the following will do it?

    <xsl:value-of select="umbraco.library:Replace($currentPage/data[@alias='richText'], '/media/', 'http://www.yoursite.com/media/')" disable-output-escaping="yes" />

    Not exactly "clean", but it might do the trick!

    Dan

  • Shaun 248 posts 475 karma points
    Feb 19, 2010 @ 14:03
    Shaun
    0

    That works dan!

    However, if I try to include an image using imagegen with the following xslt it still doesn't display

    <img border="0">
    <xsl:attribute name="src">
    <xsl:text>http://www.mywebsite.com/umbraco/ImageGen.ashx?image=</xsl:text>;
    <xsl:value-of select="umbraco.library:Replace(umbraco.library:GetMedia($currentPage/data [@alias = 'newsletterIntroGraphic'], 'false')/data [@alias = 'umbracoFile'], '/media/', 'http://www.mywebsite.com/media/')"  />
                     <xsl:text>&amp;width=210&amp;height=130</xsl:text>
             </xsl:attribute>
             <xsl:attribute name="alt">
    <xsl:value-of select="$currentPage/data [@alias = 'newsletterIntroTitle']"/>
             </xsl:attribute>
    </img>

     

    Can imagegen not handle full urls in the image parameter? 

  • dandrayne 1138 posts 2262 karma points
    Feb 19, 2010 @ 14:10
    dandrayne
    0

    I'm not sure.  What happens if you call imagegen from the browser directly, using the full path?

  • Shaun 248 posts 475 karma points
    Feb 19, 2010 @ 14:13
  • Seth Niemuth 275 posts 397 karma points
    Feb 19, 2010 @ 14:24
    Seth Niemuth
    100

    Shaun,

    Can you not just use the first image gen url (the one that works) as that will work in a HTML newsletter because it is a full path?

    http://www.challengerworld.com/umbraco/ImageGen.ashx?image=/media/10904/rttb2010.jpg&width=210&height=130

  • Shaun 248 posts 475 karma points
    Feb 19, 2010 @ 14:31
    Shaun
    0

    aaah. I see. I was under the impression that imagegen would require a full path, but of course it won't as it's already running from the correct domain.

    Silly me.

    Thanks Seth, and thanks again Dan for your help.

  • 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