2

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/*
2
  • 1
    Did you try : "fast:/*" Commented Jan 17, 2017 at 14:50
  • @SitecoreClimber. Yes. That did not work. It shows the whole content tree
    – sukesh
    Commented Jan 17, 2017 at 15:00

1 Answer 1

9

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 agree to our terms of service and acknowledge you have read our privacy policy.

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