Copied to clipboard

Flag this post as spam?

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


  • Andrew Blackmore 84 posts 127 karma points
    Feb 18, 2010 @ 19:36
    Andrew Blackmore
    0

    Beginner Question

    Hi,

    For the life of me, I cannot figure out what is wrong with this code.The item chooser spits out the corret information when it is not contained within an a href but the minute I try to create a link with it, it escapes my HTML code and breaks what I'm doing...

    <a href="<umbraco:Item ID="testItemChooser" Field="testLink" 
     XSLT="umbraco.library:NiceUrl($currentPage/data[@alias='testLink'])" 
    runat="server" />">
    Test Link
    </a>
    </div>

    I think I'm missing something stupid but I can't figure it out.

     

  • Andrew Blackmore 84 posts 127 karma points
    Feb 18, 2010 @ 19:47
    Andrew Blackmore
    1

    I figured it out. I spent a great deal of time looking for a solution and then something I tried after I posted this worked.

    I prevented the HTML from breaking by using the XSLT to insert it before and after. I needed this in a template not a macro which is why the headache ensued.

    <umbraco:Item ID="testItemChooser" Field="testLink" XSLT="umbraco.library:NiceUrl($currentPage/data[@alias='testLink'])" runat="server" insertTextBefore="<a href='" insertTextAfter="'>" />Testing 123</a>

    Hopefully this helps someone else new to this

Please Sign in or register to post replies

Write your reply to:

Draft