Copied to clipboard

Flag this post as spam?

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


  • Andrew 14 posts 34 karma points
    Sep 03, 2014 @ 12:44
    Andrew
    0

    Image Cropper - DynamicXml does not contain a definition for 'url'

    I have just started using the image cropper for the first time and I get the following error message:

     

    'umbraco.MacroEngines.DynamicXml' does not contain a definition for 'url'

     

    Any ideas what could cause this? I'm using Umbraco v6.1.2 (Assembly version: 1.0.4927.23554)

     

     This is my Razor Swhich works fine if I use @item.Image instead of @crop.url but then it displays the original image.

     

    Razor Script

    @inherits umbraco.MacroEngines.DynamicNodeContext
     
    @*
    Show Cropped Images
    *@
                    @{var productNode = @Model.NodeById(1117);}
     
        @foreach (var item in productNode.Children.Take(5))
        {         
                                    if (item.HasValue("imageCropper")) {
                                                    var crop = item.imageCropper.Find("@name", "HomeCrop");
                                                                                                    if(crop!=null){
                                                                    <li><a href="@item.Url" alt="@crop.url"><img src="@crop.url" class="img-responsive"></a></li>
                                                    }
                                    }
                    }

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

  • Barry Fogarty 493 posts 1129 karma points
    Sep 03, 2014 @ 14:18
    Barry Fogarty
    0

    Hey Andi,

    If you post a snippet of your XML it may help with debugging the issue.  That said - I would encourage you to install the DAMP package and check out the DAMP Gallery site.  It has some very useful examples of working with images and crops in Umbraco.

Please Sign in or register to post replies

Write your reply to:

Draft