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 32 posts 124 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 2 posts 72 karma points notactivated
    Sep 30, 2021 @ 11:56
    Bart
    0

    Hi Bora,

    Did you get it to work ?

    Thanks, Bart

  • 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