特定於站點的查詢
樹形結構:
/sitecore
/content
/foo-site
/home
/my-account
/bar-site
/home
/my-account
/baz-site
/home
/my-account
- 每個站點專案(
foo-site,bar-site,baz-site)的模板名為Site Node。 - 每個家居專案(
home,home,home)的模板名為Homepage - 每個使用者帳戶專案(
my-account,my-account,my-account)的模板名為User Account Page
當前專案:
當前專案可以是 home 專案或任何給定站點的 home 專案下面的任何頁面,並且此查詢仍然有效(前提是在當前的祖先 home 專案下面沒有 Homepage 模板的專案專案)。
查詢:
query:./ancestor-or-self::*[@@templatename='Homepage']/*[@@templatename='my-account']
結果:
如果從 home 專案或 foo-site 站點中的一個後代查詢:
/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