2

I am using Sitecore 9.1.1 and SXA 1.8.1

I have an item called Seat, this item is a parent to many other items on multiple levels of two templates, Topic Details and Topic Listing.

enter image description here

In Seat (my parent item), I have a search results component, where I want to return only the first level of children of Seat.

Is there a way to achieve this using the OOTB Scope query? noting that, the children are of two different templates, not just one.

My current scope query is this:

template:{TopicDetailsID};template:{TopicListingID};+sxa:UnderCurrentPage;sxa:ExcludeCurrentPage

This returns all of the children on all levels, and I'm trying to get only the first level.

  • Can you add sample items tree to your question and explain what you want to get as a result of your query? – Marek Musielak Jul 4 '19 at 14:12
  • I attached image above...sea transportation and Jetskies_Private Water Crafts PWC based on the same template and others from another template so I need to write query to get five items under sea transportation and to use the same query to get items under Jetskies_Private Water Crafts. – Mariam Nasr Jul 4 '19 at 14:32
  • so can I write query to get all item from "template 1 or template 2" and not "parent or indecent" – Mariam Nasr Jul 4 '19 at 14:40
  • An option to consider is making the three levels use different templates. Then your query would only need to use the template for the items you want returned in the search results. – Michael West Jul 8 '19 at 16:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.