Copied to clipboard

Flag this post as spam?

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


  • Matt 304 posts 726 karma points
    Sep 07, 2020 @ 14:47
    Matt
    0

    Select not working after upgrading Umbraco

    Hi all,

    I was running an early version of Umbraco 8, my website was working fine so before go live I upgraded to the latest version of Umbraco before being published.

    However a selection seems to have stopped working, I'm getting no data displayed using the following;

                @{
                    var selection = Model.ChildrenOfType("generalTemplate && generalGridLayout")
                    .Where(x => x.IsVisible());
                }
                <div class="w-row">
                    @foreach (var item in selection)
                    {
                        <div class="w-col w-col-2">
                            <a href="@item.Url" class="blue-box-test w-inline-block">
                                <h3 class="box-title">@item.Name</h3>
    
                            </a>
                        </div>
                    }
                </div>
    

    Unfortunately I get no errors, just no data.

    Thanks

  • Steve Morgan 1208 posts 3922 karma points c-trib
    Sep 08, 2020 @ 08:13
    Steve Morgan
    0

    Hi,

    It does look like that extension was changed. Try:

    string[] childTypes = { "textPage", "collectionsListingPage" };
    var selection = Model.Children().Where(x => x.IsVisible() && childTypes.Contains(x.ContentType.Alias));
    

    HTH

    Steve

Please Sign in or register to post replies

Write your reply to:

Draft