Copied to clipboard

Flag this post as spam?

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


  • tufan35 1 post 21 karma points
    Dec 04, 2020 @ 14:44
    tufan35
    0

    argument null exception value cannot be null parameter mediaitem Help

    Hi everyone I need to help us. I new started umbraco coding. I have a question for you enter image description hereI was running my project in a local environment. I could not solve this error.

    I just don't get this error here. I get this error all over the code with "pageimagesFeatured".

    @if (Model.Content.HasValue("banner2Sayfalar"))
    {
        var banner2 = Model.Content.GetPropertyValue<IEnumerable<IPublishedContent>>("banner2Sayfalar");
    
    <div class="banner-area pt-60 pb-65">
        <div class="container">
            <div class="row">
    
                    @foreach (var item in banner2)
                    {
    
                        <div class="col-lg-4 col-md-4">
                            <div class="single-banner mb-30">
                                <a href="@item.Url">
                                    @*@if (item.HasValue("pageFeaturedImage"))
                                    {
                                        IPublishedContent tempImage = item.GetPropertyValue<IPublishedContent>("pageFeaturedImage");
                                        <img src="@Url.GetCropUrl(tempImage, "kutu")" title="@tempImage.GetVortoValue("imageTitleAttribute")" alt="@tempImage.GetVortoValue("imageAltAttribute")" />
                                    }*@
                                     @if (item.HasValue("pageFeaturedImage"))
                                    {
                                        IPublishedContent tempImage = item.GetPropertyValue<IPublishedContent>("pageFeaturedImage");
                                        <img src="@Url.GetCropUrl(tempImage, "370x215")" title="@tempImage.GetVortoValue("imageTitleAttribute")" alt="@tempImage.GetVortoValue("imageAltAttribute")" />
                                    }
                                    @*<img src="/assets/img/banner/banner-1.jpg" alt="">*@
                                </a>
                                <div class="banner-content">
                                    <h3>@item.GetPropertyValue("pageTitle")</h3>
                                    <h4>@item.GetPropertyValue("pagePreviewText")</h4>
                                    <a href="@item.Url"><i class="fa fa-long-arrow-right"></i></a>
                                </div>
                            </div>
                        </div>
    
                    }
    
    
            </div>
        </div>
    </div>
    
  • Huw Reddick 1932 posts 6722 karma points MVP 2x c-trib
    Dec 04, 2020 @ 15:46
    Huw Reddick
    0

    looks like it isn't finding a pageFeaturedImage

  • 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