I am trying to set the the source field of a template using the query notation (or xpath - whichever works), but none of them seems to be working.
My content tree is a multisite content tree:
France
--Page 1
----Page1A
-------Page1AA
--Page 2
--Page 3
--METADATA
----Regions
US
--Page 1
----Page1A
-------Page1AA
--Page 2
--Page 3
--METADATA
----Regions
Each site has its own METADATA folder, and I want it so that when adding a page inside each of the main country nodes, I want the values to reflect whatever is in the METADATA of that site. I have two different fields for now - a droplink and a treelistex field. So I thought I can just get the parent item that is a country site, and get the metadata folder for that. When I put the following query in both the fields, I get different results:
query:./ancestor::*[@@templatename='CountryHome']/METADATA/Regions/*
I then tried to modify the query a little bit and took the 'query' notation out
./ancestor::*[@@templatename='CountryHome']/METADATA/Regions/*
If I go to the developer center/xpath builder, and set the context node to any item underneath the main country site, it returns me exactly what I need, but when I put this in the source, I get the entire content tree in both the cases.
Help!
Where you can use the syntax query:
or fast:
(for FastQuery):
Where you can use enhanced syntax with Parameterized datasource query:
† Droptree only supports the Datasource
and DatabaseName
parameters.
These are used like this: Datasource=/sitecore/content/home/Products/&IncludeTemplatesForDisplay=Product Category&ExcludeTemplatesForSelection=Product Description&IncludeTemplatesForSelection=Product Category
Mark Ursino has a great post on how to use this kind of syntax here.