Copied to clipboard

Flag this post as spam?

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


  • Peter van Geffen 54 posts 290 karma points
    Dec 01, 2022 @ 12:40
    Peter van Geffen
    0

    Picked items on a child page

    The situation:

    We have a 'Our team' page with team members. You can use a MultiNodeTreePicker to select multiple 'Landing Pages' to which those team members belong. And just to be clear, the 'Landing Pages' are services. Reading out the team members on those landing pages is no problem, but they must be shown on a child page of a landing page. Every landing page gets an 'Our team' page and those team members should be read out there. The code we now have is therefore fine for reading on the landing page itself, but not for an underlying page. What should be adjusted?

    @{
        var selection = Umbraco.Content(Guid.Parse("84a1edf4-a270-4fbc-8b5e-512ccecf1217"))
        .ChildrenOfType("teamlid")
        .Where(x => x.IsVisible());
        List<IPublishedContent> totalFoundItems = new List<IPublishedContent>();
        foreach(var item in selection){
            var articleSectors = item.Value<IEnumerable<IPublishedContent>>("landingspaginas");
            if (articleSectors != null){
                foreach (IPublishedContent sectorArticle in articleSectors){
                    if (sectorArticle.Id.ToString() == Model.Id.ToString()){
                        totalFoundItems.Add(item);
                    }
                }
            }
        }
        var recordsTeam = from articleNode in totalFoundItems select articleNode;
        if (recordsTeam.Count() > 0){
            foreach (var item in recordsTeam){
            }
        }
    }
    
Please Sign in or register to post replies

Write your reply to:

Draft