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.
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?
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.
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
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
hmm. No joy I'm afraid.
Hi there
If you're using xslt to render tinymce content, perhaps something like the following will do it?
Not exactly "clean", but it might do the trick!
Dan
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>&width=210&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?
I'm not sure. What happens if you call imagegen from the browser directly, using the full path?
here's my image - http://www.challengerworld.com/media/10904/rttb2010.jpg
here's what happens when I call it without the full path - http://www.challengerworld.com/umbraco/ImageGen.ashx?image=/media/10904/rttb2010.jpg&width=210&height=130
all good so far.
here's what happens when I call it with the full url
http://www.challengerworld.com/umbraco/ImageGen.ashx?image=http://www.challengerworld.com/media/10904/rttb2010.jpg&width=210&height=130
Very odd.
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
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.
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.