From 89265cd228b5e5b2cfe72dc6cd12e003717346ad Mon Sep 17 00:00:00 2001 From: sonja Date: Sun, 13 Dec 2020 12:30:41 +0100 Subject: [PATCH] Add missing cover field to note blueprint and move field to its own blueprint --- site/blueprints/fields/cover.yml | 9 +++++++++ site/blueprints/pages/album.yml | 9 +++------ site/blueprints/pages/note.yml | 3 +++ 3 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 site/blueprints/fields/cover.yml diff --git a/site/blueprints/fields/cover.yml b/site/blueprints/fields/cover.yml new file mode 100644 index 0000000..e4ae5a7 --- /dev/null +++ b/site/blueprints/fields/cover.yml @@ -0,0 +1,9 @@ +# Fields can be defined in there own field blueprints +# and reused across multiple blueprints +# This field is used in the album.yml and note.yml blueprints +# See http://getkirby.test/docs/guide/blueprints/extending-blueprints#reusing-and-extending-single-fields +type: files +multiple: false +query: page.images.template('image') +uploads: + template: image \ No newline at end of file diff --git a/site/blueprints/pages/album.yml b/site/blueprints/pages/album.yml index 69730ce..8501692 100644 --- a/site/blueprints/pages/album.yml +++ b/site/blueprints/pages/album.yml @@ -24,12 +24,9 @@ columns: # List of all available field types: # https://getkirby.com/docs/reference/panel/fields fields: - cover: - type: files - multiple: false - query: page.images - uploads: - template: image + # If you need the same field in multiple locations, you can define them once and reuse whereever needed. + # Here we use a files field defined in `/site/blueprints/field/cover.yml` + cover: fields/cover headline: type: text placeholder: "{{ page.title }}" diff --git a/site/blueprints/pages/note.yml b/site/blueprints/pages/note.yml index 8cf99b1..a771d77 100755 --- a/site/blueprints/pages/note.yml +++ b/site/blueprints/pages/note.yml @@ -38,6 +38,9 @@ columns: meta: type: fields fields: + # If you need the same field in multiple locations, you can define them once and reuse whereever needed. + # Here we use a files field defined in `/site/blueprints/field/cover.yml` + cover: fields/cover date: type: date time: true