I have a relation field in netlify-cms which prints out my multiple selected related pages. Im struggling to get hugo to go through the loop and grab the title from each page using a combo of range/GetPage.
My broken Example:
{{ range .Params.chassis.availableChassis }}
{{ with .Site.GetPage "/chassis/" . }}<h1>{{ .Title }}</h1>{{ end }}
{{ end }}
Page content:
chassis:
availableChassis:
- Nissan
- Renault
NetlifyCMS field setup:
- {label: "Chassis", name: chassis, widget: object, fields: [
{label: "Available chassis", name: "availableChassis", widget: "relation", collection: "chassis", searchFields: "title", valueField: "title", required: false, multiple: true}
]}
If i do this i get the page title from the page, but obviously its not dynamic based on CMS choice:
{{ with .Site.GetPage "/chassis/nissan" }}<h1>{{ .Title }}</h1>{{ end }}
Possibly an easier solution ive not thought of or im not looking in the right place in the docs.