树形结构:
/sitecore
/content
/foo-site
/home
/my-account
/bar-site
/home
/my-account
/baz-site
/home
/my-accountfoo-site , bar-site , baz-site )的模板名为Site Node 。home , home , home )的模板被命名为Homepagemy-account , my-account , my-account )的模板名为“ User Account Page当前项目:
当前项目可以是home项目或任何给定站点的home项目下面的任何页面,并且此查询仍然有效(假设在home项目下面没有Homepage模板的项目是当前的祖先项目)。
查询:
query:./ancestor-or-self::*[@@templatename='Homepage']/*[@@templatename='my-account']结果:
如果从foo-site站点中的home项或其后代查询:
/sitecore/content/foo-site/home/my-account如果从home项目或其中一个后代在bar-site站点中查询:
/sitecore/content/bar-site/home/my-account如果从home项目或baz-site站点中的一个后代查询:
/sitecore/content/baz-site/home/my-account