.Set "pages" $cpage.Pages }}
    {{- if $cpage.Sections}}
	    {{- .Scratch.Set "pages" ($cpage.Pages | union $cpage.Sections) }}
    {{- end}}
    {{- $pages := (.Scratch.Get "pages") }}

	{{- if eq $sortTerm "Weight"}}
		{{- template "childs" dict "menu" $pages.ByWeight "style" $style "showhidden" $showhidden "count" 1 "depth" $depth "pages" .Site.Pages "description" $withDescription "sortTerm" $sortTerm}}
	{{- else if eq $sortTerm "Name"}}
		{{- template "childs" dict "menu" $pages.ByTitle "style" $style