mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-30 05:09:06 +02:00
DOCS Specify that the selectors change the scope (#6213)
Follow up of issue #4015.
This commit is contained in:
parent
0f8f9f2732
commit
4d327f81fd
@ -326,7 +326,7 @@ When in a particular scope, `$Up` takes the scope back to the previous level.
|
|||||||
<% end_loop %>
|
<% end_loop %>
|
||||||
|
|
||||||
Given the following structure, it will output the text.
|
Given the following structure, it will output the text.
|
||||||
|
|
||||||
My Page
|
My Page
|
||||||
|
|
|
|
||||||
+-+ Child 1
|
+-+ Child 1
|
||||||
@ -341,6 +341,16 @@ Given the following structure, it will output the text.
|
|||||||
Page 'Grandchild 1' is a grandchild of 'My Page'
|
Page 'Grandchild 1' is a grandchild of 'My Page'
|
||||||
Page 'Child 2' is a child of 'MyPage'
|
Page 'Child 2' is a child of 'MyPage'
|
||||||
|
|
||||||
|
<div class="notice" markdown="1">
|
||||||
|
Additional selectors implicitely change the scope so you need to put additional `$Up` to get what you expect.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
:::ss
|
||||||
|
<h1>Children of '$Title'</h1>
|
||||||
|
<% loop $Children.Sort('Title').First %>
|
||||||
|
<%-- We have two additional selectors in the loop expression so... --%>
|
||||||
|
<p>Page '$Title' is a child of '$Up.Up.Up.Title'</p>
|
||||||
|
<% end_loop %>
|
||||||
|
|
||||||
### Top
|
### Top
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user