1

Using Sitecore 8.2 and the content tree looks like:

sitecore
|_Content
  |_Home
    |_Products
      |_Product 1
      |_Product 2
    |_Services
      |_Service 1
      |_Service 2

The items Products & Services are of the same template which has a treelist field. The items that can be selected from the treelist should be the children of that Menu item.

For eg: For Products, author should see only Product 1, 2 in its tree list. Similarly, for Services, he should see only Service 1, 2.

How can I write a query for the children path, in the template itself to achieve this. For now I'm doing these for each item at item level.

fast:/sitecore/content/home/products/*  
fast:/sitecore/content/home/services/*
  • 1
    Did you try : "fast:/*" – Vlad Iobagiu Jan 17 '17 at 14:50
  • @SitecoreClimber. Yes. That did not work. It shows the whole content tree – Qwerty Jan 17 '17 at 15:00
5

In theory the correct syntax is query:. (. being self) but there is a bug which means it does not work as expected.

I would recommend not using fast: for performance reasons, instead set the Source of your Treelist field to the following:

query:self::

This will select the current item as the root of the Treelist field.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.