Hi!
I was wondering if there’s already a way to re-use a group of fields. In my current project I have several groups of fields that are being used on different templates. For Example: an address group, consisting of street, house number, zip code, city and a country select. Or SEO-Fields (meta-fields, some text-area, html-title etc)
It’d be great if I could somehow define the fields in a way similar to global field definitions.
Thinking about something like:
// /site/blueprints/fields/address.yml
fields:
street:
label: Street
type: text
width: 3/4
house_number:
label: Housenumber
type: text
width: 1/4
zipcode:
label:
de: PLZ
en: Zipcode
type: text
width: 1/4
city:
label:
de: Stadt
en: City
type: text
width: 3/4
And then in the template-blueprint:
fields:
title:
label: Title
type: text
date:
label: Date
type: date
import: address
Though this still has a few problems, like: what about multiple imports? What about fields actually called import?
Currently it seems the closest one can get is to use structure for this and limit it to 1… but that is not ideal – unless it was possible to change the “No entries yet” - “Add the first entry” text