How can you prevent the RichTextEdit box from removing internal links
Hi There
I have a site where i create some mail templates as notmal content nodes. The user must be able to make a linke the the site that is hosting the mail template also.
The problem is if i insert a link to http://sitename/?q=XXX then after i press save the url is /?q=XXX
What kind of data field are you saving these links as? If it gets passed to XSLT (regardless of data type) you should be able to force the host domain to output.
@Thomas it's most likely coming from a rich text editor...that can make it a bit of a challenge if it's through XSLT.
If you're using XSLT to render the output though this article might be of interest if taking the approach Thomas mentions above: http://pimpmyxslt.com/articles/wysiwyg/
How can you prevent the RichTextEdit box from removing internal links
Hi There
I have a site where i create some mail templates as notmal content nodes. The user must be able to make a linke the the site that is hosting the mail template also.
The problem is if i insert a link to http://sitename/?q=XXX then after i press save the url is /?q=XXX
How can i prevent this from happening?
br
Michael
Hi Michael
Why do you want to prevent this from happening? Just curious.
/Jan
Because the text is going to be inserted into an e-mail. And the receiver of the e-mail should be able to click on the link, and get to the site :-)
What kind of data field are you saving these links as? If it gets passed to XSLT (regardless of data type) you should be able to force the host domain to output.
@Thomas it's most likely coming from a rich text editor...that can make it a bit of a challenge if it's through XSLT.
If you're using XSLT to render the output though this article might be of interest if taking the approach Thomas mentions above: http://pimpmyxslt.com/articles/wysiwyg/
/Jan
Hi Jan and Thomas
I appreciate your help.
It is the RichText Editor (hence the title of this post)
I am not doing any rendering i am using the text in an email. So i take the value og the RTE directly and sends it in an e-mail:
string body = template.GetValue<string>("bodyText");
umbraco.library.SendMail(fromAdr, adr, subject, body, true);
Hi Again
I think i found the code:
// parse current domain and instances of slash before anchor (to fix anchor bug)
// NH 31-08-2007
if (HttpContext.Current.Request.ServerVariables != null)
{
parsedString = parsedString.Replace(helper.GetBaseUrl(HttpContext.Current) + "/#", "#");
parsedString = parsedString.Replace(helper.GetBaseUrl(HttpContext.Current), "");
}
However it doesn't really say why it was made.
What i would like is a property where this could be disabled
Just discoverede that you also have to set the tinyMCE config setting:
<config key="convert_urls">false</config>
And since this feature exists, there is no reason to have the code mentioned in my previoues post
is working on a reply...