Copied to clipboard

Flag this post as spam?

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


  • Niklas Hjelm 104 posts 125 karma points
    Jun 01, 2011 @ 14:34
    Niklas Hjelm
    0

    Contentpicker with razor example?

    Has anyone used a picker with razor and want to share an example? For example getting some propertyvalues from a dataholder pagetype?

    Best regards / Niklas

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Jun 01, 2011 @ 15:28
    Jeroen Breuer
    0

    You can use the XSLT extensions in razor. For example this should work:

    umbraco.library.NiceUrl(Model.propertyName)

    Jeroen

  • John 27 posts 49 karma points
    Aug 03, 2011 @ 13:28
    John
    0

    Hi,

    How would you do this with a property with a hyphen i've tried 

    umbraco.library.NiceUrl(node.GetProperty("asl-MasterTour").Value)

    However this doesn't appear to work

     

    Thanks

    John

  • John 27 posts 49 karma points
    Aug 03, 2011 @ 15:17
    John
    0

    The full section of code is below, but still won't work:

            if(node.template > 0) {
                <url>           
                    @if (node.HasProperty("asl-MasterTour"))
                    {
                      var masterUrl = Model.NodeById(node.GetProperty("asl-MasterTour").Value).Url;
                     if (masterUrl != "") {  
                                <loc>@GetUrlWithDomainPrefix(masterUrl )</loc>
                                  }else {
                                <loc>@GetUrlWithDomainPrefix(node.Url)</loc>
                           }
                       
                    }                      
                </url>
            }



Please Sign in or register to post replies

Write your reply to:

Draft