Copied to clipboard

Flag this post as spam?

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

  • Amir Khan 1274 posts 2687 karma points
    Oct 08, 2021 @ 18:26
    Amir Khan

    MNTP2 Loop through nodes and only show selected values

    I have a blog category picker which is a multi node tree picker, the categories are defined by other documents on the site, like various industries in the industries section. The problem is, the blog is new so there are lots of empty categories. Is it possible to loop through all of the posts somehow and only show the MNTP options that have been selected on any of the posts?

    Currently I'm looping through like this, but this loop doesn't know if any of the options have been "chosen" on a blog post.

     var resourceTypeStart = Umbraco.Content(3855);
        var resourceTypeSelection = resourceTypeStart.Descendants().Where("Visible");
                        foreach (var resourceTypeFilter in resourceTypeSelection) {
                                <li><a href="/resources/[email protected]">@resourceTypeFilter.Name</a></li>
Please Sign in or register to post replies

Write your reply to: