Copied to clipboard

Flag this post as spam?

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


  • Craig100 1136 posts 2523 karma points c-trib
    May 01, 2020 @ 15:27
    Craig100
    0

    Slimsy and Grid Images (not RTE)

    Umb 8.6 + Slimsy 3.0.0-beta4

    How do you get Slimsy to srcset images that are in Grids? I can see the Partials/Grids/Editor/Media.cshtml but not sure what to do with it to get it to output srcsets.

    I added a using statement for Slimsy and then tried to replace <img src="@url" alt="@altText"> with

    <img data-srcset="@Url.GetSrcSetUrls(Model.value.image, "SideImage")"
                                data-src="@Url.GetCropUrl(Model.value.image, "SideImage")"
                                sizes="auto" class="lazyload" alt="@altText">
    

    But as the existing code is dynamic it doesn't work.

    Any clues would be appreciated.

    Incidentally, in https://github.com/Jeavon/Slimsy Item 4 wrt Rte.cshtml it would be useful to state that @Slimsy.ConvertImgToSrcSet(Html, Model.value.ToString(), true) should replace the existing @Html.Raw(value)

    Cheers,

    / Craig

  • 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