Copied to clipboard

Flag this post as spam?

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


  • Rozelle Elson 6 posts 76 karma points
    4 days ago
    Rozelle Elson
    0

    Hi

    I have installed LeBlender and have created some grid editors such as a carousel , by following the videos but when it displays on the page , I get the following error message , can you help with this ?

    The partial view '/views/partials/grid/editors/Carousel.cshtml' was not found or no view engine supports the searched locations. The following locations were searched: /views/partials/grid/editors/Carousel.cshtml

  • Alex Skrypnyk 2920 posts 8105 karma points
    4 days ago
    Alex Skrypnyk
    1

    Hi Rozelle

    Please, create '/views/partials/grid/editors/Carousel.cshtml' file and use this code as example of rendering Carousel:

    @inherits UmbracoViewPage<Lecoati.LeBlender.Extension.Models.LeBlenderModel>
    
    @if (Model.Items.Any())
    {
      <!-- Wrapper for slides -->
        <ul>
            @{
            var item = Model.Items.ElementAt(0);
    
            var imageList = item.GetValue<string>("multiImageSlider");
            if (!string.IsNullOrWhiteSpace(imageList))
                    {
                        var imgList = imageList.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse);
    
                        var imgListCollection = Umbraco.TypedMedia(imgList);
    
                        if (imgListCollection != null)
                        {
                            foreach (var img in imgListCollection)
                            {
                                <li><img src="@img.Url"></li>
                            }
                        }
                    }
            }
        </ul>
    }
    

    Thanks,

    Alex

Please Sign in or register to post replies

Write your reply to:

Draft