 $noChildren := $.Scratch.Get "noChildrenItems" }}
                {{ $.Scratch.Set "noChildrenItems" ($noChildren | append .) }}
                {{ end }}
                {{ end }}

                {{/* Render items with children first, each wrapped in its own column */}}
                {{ range . }}
                {{ if .HasChildren }}
                <div class="column">
                    <p class="top-menu-item">{{ .Name }}</p>
                    <ul>
                        {{ range .Children }}
 