Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor edits to the XPath query help sheet #11385

Merged
merged 2 commits into from
Oct 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 18 additions & 13 deletions src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treesource.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</button>
<div class="mt2" ng-show="model.value.type == 'content'">
<umb-icon icon="icon-search" class="icon"></umb-icon>
<button type="button" class="btn-link" ng-click="showSearch = true">Query for root node with xpath</button>
<button type="button" class="btn-link" ng-click="showSearch = true">Query for root node with XPath</button>
</div>
</div>

Expand All @@ -36,32 +36,37 @@
<input type="text"
ng-model="model.value.query"
class="umb-property-editor umb-textstring"
placeholder="Enter xpath query">
placeholder="Enter XPath query">

<ul class="unstyled list-icons mt3">
<li style="max-width: 600px">
<umb-icon icon="icon-help-alt" class="icon"></umb-icon>
<button type="button" class="btn-link" ng-click="showHelp = !showHelp">{{showHelp ? 'Hide' : 'Show'}} xpath query help</button>
<button type="button" class="btn-link" ng-click="showHelp = !showHelp">{{showHelp ? 'Hide' : 'Show'}} XPath query help</button>

<div class="small" ng-show="showHelp">
<p>
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.
</p>

<p>
Placeholders finds the nearest published ID and runs its query from there, so for instance:

<pre>$parent/newsArticle</pre>

Will try to get the parent if available, but will then fall back to the nearest ancestor and query for all news articles there.
A placeholder finds the nearest published ID and runs its query from there, so for instance:
</p>

<pre>$parent/newsArticle</pre>

<p>
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.
</p>

<p>
Available placeholders: <br/>
<code>$current</code>: current page or closest found ancestor<br/>
<code>$parent</code>: parent page or closest found ancestor<br/>
<code>$root</code>: root of the content tree<br/>
<code>$site</code>: Ancestor node at level 1 <br/>
<code>$current</code>: Current page or closest found ancestor<br/>
<code>$parent</code>: Parent page or closest found ancestor<br/>
<code>$root</code>: Root of the content tree<br/>
<code>$site</code>: Ancestor node at level 1<br/>
</p>
<p>
Note: The placeholder can only be used at the beginning of the query.
</p>
</div>
</li>
Expand Down