Copied to clipboard

Flag this post as spam?

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


  • Mus'ab 155 posts 379 karma points notactivated
    Jul 10, 2019 @ 06:32
    Mus'ab
    0

    Hello,

    I am using Examine Search to list products, and what i used to list products under a specific parent is the below code :

    var results = searcher.CreateQuery("content").ParentId(1105).Execute();
    

    where the 1105 is the products folder node ID
    and this works when the structure is like this :

    -- Products Folder
    ----- Product1
    ----- Product2

    This wouldn't return the products when if I add a new level such as Year like below:

    -- Products Folder
    ----- 2019
    ------------ Product1
    ------------ Product2
    ------------ Product3

    Note I don't want to put the 2019 node ID in the Examine Query as a ParentID

  • aaeda 113 posts 145 karma points
    Jan 07, 2020 @ 06:13
    aaeda
    0

    Hello

    Anyone has a solution for the issue above please?

    Thanks

  • Joep 74 posts 554 karma points
    Jan 07, 2020 @ 16:19
    Joep
    0

    Hey @Mus'ab,

    You could do something like this: var results = Umbraco.Web.Composing.Current.UmbracoHelper.Content(1105).Descendants<{{Product Document Type}}>().ToList();

    Kind regards,

    Joep

Please Sign in or register to post replies

Write your reply to:

Draft