Closed
Description
Requesting support to create menu entries with properties using a content adapter, per feedback in my forum post.
In #12507, @jmooring requested support for menu entry creation in content adapters. The resulting implementation in 245928a supports defining flat menu entries:
Front Matter | Content Adapter |
---|---|
menus: main |
{{ .AddPage (dict "menus" "main" [...]) }} |
menus: [main, footer] |
{{ .AddPage (dict "menus" (slice "main" "footer") [...]) }} |
However, it's not possible to create menu entries with properties within a content adapter, equivalent to defining the following in front matter:
menus:
main:
parent: main-page
identifier: example-id
I expected that passing a map would work:
{{- $mainMenu := dict
"parent" "main-page"
"identifier" "example-id"
-}}
{{- $menus := dict "main" $mainMenu -}}
{{- .AddPage (dict "menus" $menus [...]) -}}
But it seems menus are defined as an array of strings. Maybe it should be a map, like Params
?
Thank you!