Copied to clipboard

Flag this post as spam?

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


  • Anthony Candaele 1197 posts 2049 karma points
    Dec 04, 2011 @ 10:59
    Anthony Candaele
    0

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

    Hi,

    I have installed the Digibiz Advanced Media Picker and the DAMP Samples package.

    Following the sample code, I have implemented the Digibiz Advanced Media Picker type to show image crops in a slider (Flex Slider):

    @inherits umbraco.MacroEngines.DynamicNodeContext
    @using DigibizAdvancedMediaPicker;

    @{
        //Check the currentpage has value in the property 'arrangementImageSlider'
        if (Model.HasValue("arrangementImageSlider"))
        {
                    
            <div class="flexslider-container">
                <div class="flexslider">
                    <ul class="slides">
                        @foreach (dynamic photo in Model.arrangementImageSlider)
                        {
                            <li>
                                <img src="@DAMP_Helper.GetImageCropperUrl(photo, "lunchCrop")" alt="@photo.arrangementImageSlider.nodeName"/>
                                <class="flex-caption">@photo.arrangementImageSlider.nodeName</p>
                            </li>
                        }
                    </ul>
                </div>
            </div>
        }
    }

    However instead of the images rendered in my slider, I get this Razor error message:

    Error loading Razor Script ImageSlider.cshtml
    'umbraco.MacroEngines.DynamicXml' does not contain a definition for 'arrangementImageSlider'

    Does anyone have an idea what the problem could be? 

    "arrangementImageSlider" is a property defined for my "Arrangement" document type. This property uses a the custom datatype 'ImagesLunchPakket' which in turn implements the Digibiz Advanced Media Picker.

    Thanks for your help,

    Anthony

  • Anthony Candaele 1197 posts 2049 karma points
    Dec 04, 2011 @ 13:07
    Anthony Candaele
    0

    yes! Found the error. The problem is that I had to speficy the mediatype (SliderImage) to get the nodeName property, instead of the propertyname of the documenttype, so this is the correct code:

    @inherits umbraco.MacroEngines.DynamicNodeContext
    @using DigibizAdvancedMediaPicker;

    @{
        //Check the currentpage has value in the property 'arrangementImageSlider'
        if (Model.HasValue("arrangementImageSlider"))
        {
                    
            <div class="flexslider-container">
                <div class="flexslider">
                    <ul class="slides">
                        @foreach (dynamic photo in Model.arrangementImageSlider)
                        {
                            <li>
                                <img src="@DAMP_Helper.GetImageCropperUrl(photo, "lunchCrop")" alt="@photo.SliderImage.nodeName"/>
                                <class="flex-caption">@photo.SliderImage.nodeName</p>
                            </li>
                        }
                    </ul>
                </div>
            </div>
        }
    }

     

    Greetings,
    Anthony

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies