I feel like I’m overlooking something, but I’m trying to get an array of the fields in my page to iterate over.
In my blueprint for the page I have this:
title: Page
pages: true
files: true
fields:
title:
label: Title
type: text
housestyleimage:
label: Housestyle Image
type: text
housestyle:
label: House Style
type: textarea
logos:
label: Logos
type: textarea
color:
label: Color
type: textarea
fonts:
label: Fonts
type: textarea
I was hoping I could do something like $page->fields() to get an array of the fields, but this doesn’t seem to be the case. What would be the best way to get an array of all the field’s labels?
I thought this would solve it for me, but I actually want to access the label that’s in the blueprint (in my example above those would be Title, Housestyle Image, Logos, Color, Fonts). Is there any way to get to that?
The label of the field only exists for display in the panel, it cannot be accessed via template (or not that I know of). As a workaround, you could probably map your fields and labels in your config file, or if you are on a multi language site, in your language files, and then access those variables in your template.