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 361 posts 915 karma points
    6 days ago
    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 11222 posts 23231 karma points MVP 5x admin c-trib
    6 days ago
    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 361 posts 915 karma points
    6 days ago
    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 5178 posts 18868 karma points MVP 2x admin c-trib
    6 days ago
    Alex Skrypnyk
    100

    Hi Craig

    Try this code:

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

    Alex

  • Craig O'Mahony 361 posts 915 karma points
    6 days ago
    Craig O'Mahony
    1

    Legend!

Please Sign in or register to post replies

Write your reply to:

Draft