From 3c0d6e5d0400e84436a4e41e2d14456583e09bec Mon Sep 17 00:00:00 2001
From: Chriztian Steinmeier
Date: Sun, 3 Oct 2021 19:00:58 +0200
Subject: [PATCH 1/2] Clarify the use of placeholders
Since the placeholder is only replaced if it's at the beginning of the query, I've added a note about it.
Also made the spelling of XPath consistent and fixed a nesting error in the HTML.
---
.../src/views/prevalueeditors/treesource.html | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treesource.html b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treesource.html
index f56a6c8656ad..4a52fa4ab0ed 100644
--- a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treesource.html
+++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treesource.html
@@ -27,7 +27,7 @@
- Use Xpath query to set a root node on the tree, either based on a search from the root of the content tree, or by using a context-aware placeholder.
+ Use an XPath query to set a root node on the tree, either based on a search from the root of the content tree, or by using a context-aware placeholder.
Placeholders finds the nearest published ID and runs its query from there, so for instance:
-
-
$parent/newsArticle
-
+
+
+
$parent/newsArticle
+
+
Will try to get the parent if available, but will then fall back to the nearest ancestor and query for all news articles there.
@@ -63,6 +65,9 @@
$root: root of the content tree $site: Ancestor node at level 1
+
+ Note: The placeholder can only be used at the beginning of the query.
+
- Placeholders finds the nearest published ID and runs its query from there, so for instance:
+ A placeholder finds the nearest published ID and runs its query from there, so for instance:
$parent/newsArticle
- Will try to get the parent if available, but will then fall back to the nearest ancestor and query for all news articles there.
+ Will try to get the parent if available, but will then fall back to the nearest ancestor and query for all news article children there.
Available placeholders:
- $current: current page or closest found ancestor
- $parent: parent page or closest found ancestor
- $root: root of the content tree
- $site: Ancestor node at level 1
+ $current: Current page or closest found ancestor
+ $parent: Parent page or closest found ancestor
+ $root: Root of the content tree
+ $site: Ancestor node at level 1
Note: The placeholder can only be used at the beginning of the query.