Copied to clipboard

Flag this post as spam?

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


  • Michael Falk 37 posts 59 karma points
    Jun 04, 2013 @ 08:34
    Michael Falk
    0

    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

     

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jun 04, 2013 @ 19:07
    Jan Skovgaard
    0

    Hi Michael

    Why do you want to prevent this from happening? Just curious.

    /Jan

  • Michael Falk 37 posts 59 karma points
    Jun 04, 2013 @ 19:32
    Michael Falk
    0

    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 :-)

  • Thomas Brinegar 84 posts 162 karma points
    Jun 04, 2013 @ 21:52
    Thomas Brinegar
    1

    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.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jun 04, 2013 @ 22:58
    Jan Skovgaard
    0

    @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

  • Michael Falk 37 posts 59 karma points
    Jun 05, 2013 @ 08:19
    Michael Falk
    0

    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);

     

     

  • Michael Falk 37 posts 59 karma points
    Jun 05, 2013 @ 09:03
    Michael Falk
    0

    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

  • Michael Falk 37 posts 59 karma points
    Dec 20, 2013 @ 14:01
    Michael Falk
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft