diff --git a/layouts/shortcodes/children.html b/layouts/shortcodes/children.html
index a1e31b2ac2..fe208398c5 100644
--- a/layouts/shortcodes/children.html
+++ b/layouts/shortcodes/children.html
@@ -67,11 +67,11 @@
{{if eq $.style "li"}}
{{end}}
- {{ $.Page.Scratch.Set "pages" .Pages }}
+ {{ .Scratch.Set "pages" .Pages }}
{{ if .Sections}}
- {{ $.Page.Scratch.Set "pages" (.Pages | union .Sections) }}
+ {{ .Scratch.Set "pages" (.Pages | union .Sections) }}
{{end}}
- {{ $pages := ($.Page.Scratch.Get "pages") }}
+ {{ $pages := (.Scratch.Get "pages") }}
{{if eq $.sortTerm "Weight"}}
{{template "childs" dict "menu" $pages.ByWeight "style" $.style "showhidden" $.showhidden "count" (add $.count 1) "depth" $.depth "pages" $.pages "description" $.description "sortTerm" $.sortTerm}}