Copied to clipboard

Flag this post as spam?

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

  • Natasha 9 posts 99 karma points
    Dec 05, 2019 @ 15:37

    Hi There

    I am trying to implement snipcart on my site. It's been a while since i've used umbraco so this code from the tutoria here throws an error I am using version 8.1.4. I have tried doing it myself but get stumped at adding an image from childpages all I can do is list the sub pages :

    @{ var selection = Model.Children.Where(x => x.IsVisible()).ToArray(); }
    @if (selection.Length > 0)
            @foreach (var item in selection)
        var image = Model.Value<IPublishedContent>("image");
        if (image != null)
            <img src="@image.Url" style="width:200px" alt="@image.Value("alt")" />

    Please help it's driving me craaaazy!

  • Yakov Lebski 517 posts 2032 karma points
    Dec 05, 2019 @ 17:41
    Yakov Lebski

    enter image description here

    I think here should be item.Value ...

Please Sign in or register to post replies

Write your reply to: