Copied to clipboard

Flag this post as spam?

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


  • David Daly 7 posts 91 karma points
    May 10, 2017 @ 14:35
    David Daly
    1

    Broken links on Child nodes

    Hi, I have an issue where when cycling though child nodes:

    @foreach (var block in CurrentPage.Children)
                {
    
                    <h2>@block.title</h2>
                   @Html.Raw(block.GetPropertyValue("content"))
    
                }
    

    (the content is just HTML) any links in the HTML have strange href values like:

    <a href=<a href="url">link</a>>link</a>
    

    Obviously this doesn't go anywhere useful. Any help would be much appreciated.

  • Alex Skrypnyk 6182 posts 24283 karma points MVP 8x admin c-trib
    May 10, 2017 @ 14:39
    Alex Skrypnyk
    0

    Hi David

    Can you show how its storing in Umbraco?

    I mean "content" property.

    Thanks,

    Alex

  • David Daly 7 posts 91 karma points
    May 10, 2017 @ 14:40
    David Daly
    1
    <section id="1107" key="e34324ff-5e8b-426b-ab4e-9901eab1f909" parentID="1071" level="4" creatorID="0" sortOrder="0" createDate="2017-05-10T09:19:01" updateDate="2017-05-10T14:13:51" nodeName="Know How" urlName="know-how" path="-1,1053,1057,1071,1107" isDoc="" nodeType="1099" creatorName="David Daly" writerName="David Daly" writerID="0" template="0" nodeTypeAlias="section"><content><![CDATA[<p>5 Things to Know - Capital Allowances, Indemnities, Japanese Knotweed, Promap, SearchFlow Tue 25 Apr 2017 - <a href="http://newforstersintranet/CommercialRealEstate/CommercialRealEstateKnowHowDetail.aspx%3FHowID=2368">Read more</a> Talk on MEES and EPCs (19.04.17) Thu 20 Apr 2017 - <a href="http://newforstersintranet/CommercialRealEstate/CommercialRealEstateKnowHowDetail.aspx%3FHowID=2367">Read more</a> Know How Meeting (20.04.2017)<br /> Thu 20 Apr 2017 - <a href="http://newforstersintranet/CommercialRealEstate/CommercialRealEstateKnowHowDetail.aspx%3FHowID=2366">Read more</a> Solicitors Journal April 2017 Quarterly Update<br /> Tue 18 Apr 2017 - <a href="http://newforstersintranet/CommercialRealEstate/CommercialRealEstateKnowHowDetail.aspx%3FHowID=2365">Read more</a> &gt;5 Things to Know - Highways Searches, Buyer's Liens, Lease Cancellations, Indemnity Insurance<br /> Tue 11 Apr 2017 - <a href="http://newforstersintranet/CommercialRealEstate/CommercialRealEstateKnowHowDetail.aspx%3FHowID=2364">Read more</a></p>]]></content><title><![CDATA[Know How]]></title></section>
    
  • Alex Skrypnyk 6182 posts 24283 karma points MVP 8x admin c-trib
    May 10, 2017 @ 14:43
    Alex Skrypnyk
    0

    It looks like right HTML data.

    Are you sure that this data is in the page?

    Can it be replaced or handled in some other place, just after rendering?

    Thanks,

    Alex

  • David Daly 7 posts 91 karma points
    May 10, 2017 @ 14:55
    David Daly
    1

    The data definitely appears in the page and renders as Html but the href in the links renders as the entire <a> tag.

    How would I check whether its's handled elsewhere?

    Oh thanks for looking by the way, much appreciated.

  • Alex Skrypnyk 6182 posts 24283 karma points MVP 8x admin c-trib
    May 10, 2017 @ 15:01
    Alex Skrypnyk
    0

    you are welcome, can you check please source code of the page on the site?

    Is it good HTML?

    How do you inspecting links now?

  • David Daly 7 posts 91 karma points
    May 12, 2017 @ 09:57
    David Daly
    1

    Sorry for the late reply I've had no internet access.

    I'm inspecting the Html with chrome developer tools and everything is fine except for the links.

    Oddly, when I view the source the link appears correctly but if I use Inspect Element it has the previously mentioned issue.

    Which leads me to think its a javascript issue maybe?

  • Alex Skrypnyk 6182 posts 24283 karma points MVP 8x admin c-trib
    May 12, 2017 @ 10:48
    Alex Skrypnyk
    100

    Hi David,

    Yes, your links are ok after rendering on the server, something wrong with html or js in the browser.

    Try to investigate what scripts are working with this part of page.

    Hope it will help,

    Alex

  • David Daly 7 posts 91 karma points
    May 12, 2017 @ 15:08
    David Daly
    0

    Hi Alex, sorry for the time waste, it was indeed some rogue Javascript on the masterpage (written by someone less than qualified).

    Thanks for your time.

  • Alex Skrypnyk 6182 posts 24283 karma points MVP 8x admin c-trib
    May 12, 2017 @ 20:58
    Alex Skrypnyk
    0

    You are welcome, David. Have a great weekend.

    Alex

Please Sign in or register to post replies

Write your reply to:

Draft