Copied to clipboard

Flag this post as spam?

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


  • Craig O'Mahony 364 posts 918 karma points
    Apr 16, 2019 @ 10:42
    Craig O'Mahony
    0

    RTE links rendering a potentially dangerous request link

    Hi all,

    I'm looping though some nodes/content blocks and rendering the content that has been entered in the rich text editor onto the page but when the content appears on the page all of the links are formatted like this:

    <a data-udi="umb://document/eecf6327430a43cc9344a737f27c779f" href="/{localLink:umb://document/eecf6327430a43cc9344a737f27c779f}" title="Become a Member" class="btn btn-primary">my link</a>
    

    Which obviously isn't a valid link has anyone seen this behaviour before and any suggestions on a cure?

    Thanks, C

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 16, 2019 @ 10:53
    Jan Skovgaard
    0

    Hi Craig

    That does indeed look at bit odd - What does your code for rendering the rich text editor look like? And what exact version of Umbraco are you using?

    /Jan

  • Craig O'Mahony 364 posts 918 karma points
    Apr 16, 2019 @ 11:03
    Craig O'Mahony
    0

    Hi Jan,

    The content is being loaded using the Archtype datatype property:

    enter image description here

    Which is then being looped through on the partial page:

    var homeNode = new umbraco.NodeFactory.Node(myHome);
    var tabs = new ArchetypeModel();
    
    tabs = JsonConvert.DeserializeObject<ArchetypeModel>(homeNode.GetProperty("tabulatedArea").Value);
    
    foreach (var tab in tabs)
    {
        <div class="col-md-6 bg-white">
             <div class="panel lg">
                  @Html.Raw(tab.GetValue("rightAreaContent"))
             </div>
        </div>
    }
    

    Thanks, Craig

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Apr 16, 2019 @ 13:36
    Alex Skrypnyk
    100

    Hi Craig

    Try this code:

    @Html.Raw(umbraco.template.ParseInternalLinks(tab.GetValue("rightAreaContent")))
    

    Alex

  • Craig O'Mahony 364 posts 918 karma points
    Apr 16, 2019 @ 15:07
    Craig O'Mahony
    1

    Legend!

Please Sign in or register to post replies

Write your reply to:

Draft