Copied to clipboard

Flag this post as spam?

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

  • Craig P 9 posts 90 karma points
    Jul 01, 2021 @ 14:53
    Craig P

    Returning only nodes that appear in a tag list?!


    I have a product section with hundreds of produc nodes. Each has a product code. I have created a document type which allows an editor to create their own bespoke category list page by giving the category a name and content and then a list of products which should appear under it.

    The pseudo code is below to give an idea of what I am looking for but I have tried different ways and come up with nothing that works.

    var selection = Umbraco.Content(Guid.Parse(theGUID))
    .Where(x => x.IsVisible())

    I have also tried googling searching nodes that appear in tag list but it just comes up with lots of articles about searching nodes which contain something in their taglist. Any help or pointers would be appreciated.


  • Brendan Rice 501 posts 915 karma points
    Jul 01, 2021 @ 15:50
    Brendan Rice
    var myFilteredArticles = articles.Where(x => x.Value("category") != null && ((string[])x.Value("category")).Any(y => y.ToLower().Contains(category.ToLower())));
Please Sign in or register to post replies

Write your reply to: