November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
I had this same issue and could not find a concrete solution for this, I had to re-insert the domain using a find and replace before sending the email
Regex pattern = new Regex("(href|src)([^\"|']{1,3})([\"|']/)", RegexOptions.IgnoreCase);
emailBody = pattern.Replace(emailBody,string.Format("$1$2\"{0}/",ConfigurationManager.AppSettings["HostUrl"]));
I'm really trying to avoid that but if all else fail, that would be my last resort.
I'm still hoping that that there's a way to turn it off. Hopefully someone from EPiServer knows an answer.
Yeah, I have had this problem also. Why why why give an option to go to html mode and then mess up the code afterwards.
Iam also making newsletters, and it is hard as it is. Here is what I did, I had to make seperate propertys for the img's, see code. But Iam guessing you have figured that out. I think, if you really want the editor to be able to place the img's in an xhtml editor you can make the xhtmleditor work like in epi 5, Iam trying to find where you do that but cant find it neither under the settings for the property nor under admin>config, but I think it is possible (maybe in Epi 6 R2, I have R1 here at work).
Maybe you should take a look at this too:
http://tedgustaf.com/en/blog/2011/4/publishing-plain-html-pages-in-episerver/
<img src="http://www.xyz.com<%= CurrentPage["TheProperty"] %>" />
<!-- *In the page type: TheProperty = URLtoIMAGE -->
Hi!
There are a couple of possible places where url-rewriting could take place so to narrow down the problem I need some more context. The places are:
Is the data stored as a property? If so, does the initial post to save the values have the correct data or has it been rewritten here already?
It's within the Tiny MCE (via a page Property).
So within the HTML Editor, when I have something written like:
<td colspan="3"><img src="http://masterpet.com/Global/Promo/YDemail.jpg" alt="" width="800" /></td>
And I click on update, and opened the HTML editor again, it will be rewritten as:
<td colspan="3"><img src="/Global/Promo/YDemail.jpg" alt="" width="800" /></td>
This will not work as we're using this for newsletters.
Hi again!
Here some test code that I did to rewrite URL:s to be absolute. I have just done basic testing so the code is provided as is:
var builder = new StringBuilder();
PropertyXhtmlString mainbody = CurrentPage.Property["mainbody"] as PropertyXhtmlString;
foreach (IStringFragment fragment in mainbody.Fragments)
{
UrlFragment urlFragment = fragment as UrlFragment;
if (urlFragment != null)
{
var url = new Url(urlFragment.GetViewFormat());
Uri uri = UriSupport.CreateAbsoluteUri(url);
builder.Append(uri.ToString());
}
else
{
builder.Append(fragment.GetViewFormat());
}
}
Mailtest.Text = builder.ToString();
Hi Linus,
Thanks for the code, though code modification was really my last resort. I was hoping that there was a switch or config somewhere so that the URL won't get messed up. Looks like there's none.
I understand. Since the issue seems to be inside of Tiny MCE I'd suggest to post on the Tiny MCE forums to see if someone there can help you.
I have a page with xhtml property and whenever I put an img src="www.currentsite.com/global/myimage.png" and publish the page, it cleans up the URL and modifies it to img src="/global/myimage.png" which makes sense.
But I don't want it to be this "clever" as I'm using this xhtml property for sending email newsletters and truncating the domain from the image src would mean that the images won't be displayed properly.
Is there a way to disable this auto code cleanup function?