Copied to clipboard

Flag this post as spam?

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


  • Daniel B Christensen 15 posts 115 karma points
    Sep 30, 2021 @ 12:46
    Daniel B Christensen
    0

    Grid RTE insert/edit link results in invalid links.... sometimes

    Umbraco Version: 7.7.2

    I'm experincing a problem where inserting a link to another content node in the grid RTE, the resulting link is invalid.

    Example:

    When selecting a node like this enter image description here

    it results in the following html in the RTE.

    <a data-udi="umb://document/dec6080f26284977a6f72ae84703f284" href="../{localLink:umb:/document/dec6080f26284977a6f72ae84703f284}" title="Studiekontrol">sdgbhgf</a>
    

    When this is rendered, it results in the following URL, when running locally: http://localhost:11777/%7BlocalLink:umb://document/dec6080f26284977a6f72ae84703f284%7D

    The problem with these links isn't a constant problem, but seem to appear now and again. Any suggestion on how to solve the problem?

  • Lucas Michaelsen 32 posts 232 karma points
    Sep 30, 2021 @ 14:00
    Lucas Michaelsen
    0

    Hello Danial.

    Sry, to hear. A solution can run your rich text thouge umbraco internallink parser like this:

    @using Umbraco.Web.Templates
    
    string html = Templates.TemplateUtilities.ParseInternalLinks(rteValue, UmbracoContext.Current.UrlProvider);
    
    @Html.Raw(html)
    

    hope it will work

  • Daniel B Christensen 15 posts 115 karma points
    Oct 05, 2021 @ 13:47
    Daniel B Christensen
    0

    Hello Lucas,

    I've confirmed that the rendered data is passed through the following code

    @model dynamic
    @using Umbraco.Web.Templates
    
    @Html.Raw(TemplateUtilities.ParseInternalLinks(Model.value.ToString()))
    

    I've also tried replacing this with your version which supplies the URL provider directly. However the result is the same.

    Any other suggestions on how to solve this?

Please Sign in or register to post replies

Write your reply to:

Draft