I have a branch template that is used to create a landing page with related content. I want to set the data source of the parent page's content sublayout to the parent page's content item child.
test-landing-page <-- This is the parent page item with the content sublayout
--test-content-item <-- This is the content item
Since I control the name of the content item via the branch template, I can reliably predict what the data source ought to be (using $name for the child content item that is). This Sitecore query returns my item when I test it in XPath Builder:
/sitecore/content/Sites/home/landing-pages/descendant::*[@@name = 'test-landing-page']/*[@@name = 'test-landing-page']
The only issue is that the query does not set the data source for the sub layout. Indeed, when I use the 'Build query' option it does not return any results. I tried using the query builder to create something similar but the options (and documentation) are too limited.
Is setting the data source via a Sitecore query or fast query just not possible or is there a way to construct this query using the Query builder that I am somehow missing?