Copied to clipboard

Flag this post as spam?

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


  • Kim Andersen 1447 posts 2197 karma points MVP
    Mar 26, 2014 @ 15:29
    Kim Andersen
    0

    "localLink" from RTE doesn't render as a link in v6.1.6

    Hi guys

    I have a weird problem regarding the "Insert/Edit link" option in the richtext editor.

    The problem occours in Umbraco v6.1.6 on several installations.

    This is what happens:

    1. Insert a local link in the RTE from the "Insert/Edit link"-option.
    2. When the content from the Richtext editor is rendered on the frontend, the link isn't converted to a real link, but still appears as a /{localLink:2122}

    We are using XSLT to render the content from the RTE, and have tried several ways:

    Eg.:

    <xsl:value-of select="$currentPage/content" disable-output-escaping="yes" />
    

    Or: through an apply-templates using a basic:

    <xsl:value-of select="." disable-output-escaping="yes" />
    

    or through an extension like:

    <xsl:value-of select="umbraco.library:RenderMacroContent(., $currentPage/@id)" disable-output-escaping="yes"/>
    

    Another weird thing is that we have some other Umbraco v6.1.6 solution where this stuff works, but on some of our other solutions it doesn't work.

    We have tried a lot of the usual stuff like, republishing, resetting the IIS, touching the web.config, deleting the umbraco.config and republish and stuff like that. But nothing seems to help.

    We have also tried comparing installed packages, but there's no difference in one of the solutions that works and another that doesn't work.

    So I'm kind of running out of ideas here. Have any of you seen this issue before, or have an idea to what might cause the problem?

    Thanks in advance!

    /Kim A

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Mar 26, 2014 @ 15:53
    Ismail Mayat
    0

    Kim,

    I am sure I have seen this before let me dig around because I am sure i asked question about it.

    Regards

    Ismail

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Mar 26, 2014 @ 15:59
    Ismail Mayat
    0

    Kim,

    Are you doing anything with http modules also what happens when you put {localLink:2122} in to a template and also when write out the rich text field directly in template or razor macro?

    Regards

    Ismail

  • Dan Lister 416 posts 1974 karma points c-trib
    Mar 26, 2014 @ 16:07
    Dan Lister
    0

    Hi Kim,

    I've seen this a few times. I usually use a custom extension method like the one below to output links correctly. You could adapt it so that the method could be used on your XSLT template.

    Thanks,
    Dan.

    public static HtmlString ToHtml(this string str)
    {
        return string.IsNullOrWhiteSpace(str) 
            ? new HtmlString(string.Empty)
            : new HtmlString(Umbraco.Web.Templates.TemplateUtilities.ParseInternalLinks(str));
  • Kim Andersen 1447 posts 2197 karma points MVP
    Mar 26, 2014 @ 21:21
    Kim Andersen
    0

    Hi Ismail

    If I try rendering the content from the RTE through Razor directly in the View like this:

    @CurrentPage.Content
    

    the link is rendered correctly.

    If I try inserting the {localLink:2122} that string is just shown on the frontend. Don't know if that was what you thought about :)

    Regarding the HTTP modules you talked about, I don't tink that we're doing anything special, but I will take a look at that tomorrow.

    /Kim A

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Mar 27, 2014 @ 16:00
    Ismail Mayat
    0

    Kim,

    My suggestion about adding in template directly i think that stopped working around v452? Anyhow that fact that it works in razor would suggest something wrong in xslt and not the http modules?

    Regards

    Ismail

Please Sign in or register to post replies

Write your reply to:

Draft