Copied to clipboard

Flag this post as spam?

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


  • Bora B 28 posts 109 karma points
    Jan 07, 2020 @ 14:17
    Bora B
    0

    image cropper in model.children not working

    Hi,

    In V8.4 the following code gives the error

    [ArgumentNullException: Value cannot be null. Parameter name: mediaItem]

    for the line

    var image = item.Value

    TeamMemberPhoto is a imagecropper and not null.

    I cannot find the solution. Published the page and document type several times. Can somebody help me please.

    @foreach (var item in selection)
    {
      <div class="team-member">
         <div class="team-member_image">
         @if (item.Value("TeamMemberPhoto") != null)
         {
          <div class="team-member_image">
           @{
             var image = item.Value<IPublishedContent>("TeamMemberPhoto");
            }
            <img src="@image.GetCropUrl("listPhoto")">
          </div>
         }
      </div>
    }
    

    Thanks, Bora

  • Bart 1 post 71 karma points notactivated
    Sep 30, 2021 @ 11:56
    Bart
    0

    Hi Bora,

    Did you get it to work ?

    Thanks, Bart

Please Sign in or register to post replies

Write your reply to:

Draft