Copied to clipboard

Flag this post as spam?

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


  • Igor Dragutinovic 8 posts 28 karma points
    Feb 05, 2015 @ 13:51
    Igor Dragutinovic
    0

    Grid Layout insert link

    I am trying to add link to another umbraco node in the Grid Layout rich text editor. Instead of valid URL I'm getting something like this 

    <a href="../{localLink:1636}" title="test">link</a>

    This is the link to the TemplateUtilities class that is used for extracting links from the Grid Layout data.

    https://github.com/umbraco/Umbraco-CMS/blob/7.2.1/src/Umbraco.Web/Templates/TemplateUtilities.cs

    One thing is suspicious in code, regex matching on the line 56, if it fails there is no replacing of json data with proper url.

    External links are inserted properly.

    I'm using latest Chrome on Win7 machine, Umbraco version 7.2.1

  • Igor Dragutinovic 8 posts 28 karma points
    Feb 06, 2015 @ 09:23
    Igor Dragutinovic
    0

    I fixed this by changing regex in the TemplateUtilities method ParseInternalLinks. 

    Line 56 now looks like this (in my code)

                var tags = Regex.Matches(text, @"href=""\.*[/]?(?:\{|\%7B)localLink:([0-9]+)(?:\}|\%7D)", RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace);

Please Sign in or register to post replies

Write your reply to:

Draft