# Global Field Definitions for i.e. \`files\` field in blueprints

**URL:** <https://forum.getkirby.com/t/global-field-definitions-for-i-e-files-field-in-blueprints/7683>\
**Category:** Questions\
**Tags:** v2\
**Created:** [June 8, 2017, 1:49pm UTC](https://forum.getkirby.com/t/global-field-definitions-for-i-e-files-field-in-blueprints/7683 "2017-06-08T13:49:01Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![wottpal](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/wottpal/32/4439_2.png) [@wottpal](https://forum.getkirby.com/u/wottpal)\
**Post date:** [June 8, 2017, 1:49pm UTC](https://forum.getkirby.com/t/global-field-definitions-for-i-e-files-field-in-blueprints/7683/1 "2017-06-08T13:49:01Z")

</div>

Hey,  
I’ve recently discovered the new _Global Field Definitions_ feature - And i love it. However it doesn’t seem to be possible to use it outside the main `fields` key (i.e. for `files` or even `files > fields`). I often add a lot of textfields (like _Title_, _Description_, _Source_, _Source-URL_, …) to Image-Files and would be so thankful if I could share these across my different blueprints.

For Reference: [https://getkirby.com/docs/panel/blueprints/global-field-definitions](https://getkirby.com/docs/panel/blueprints/global-field-definitions)

Dennis

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [June 8, 2017, 1:54pm UTC](https://forum.getkirby.com/t/global-field-definitions-for-i-e-files-field-in-blueprints/7683/2 "2017-06-08T13:54:35Z")

</div>

Hm, I just tested this and seems to work:

Blueprint:

```auto
title: Article
files:
  fields:
    caption: caption

```

Field definition /site/blueprints/fields/caption.yml

```auto
label: Caption
type: text

```

Could you please post your example that does not work?

---

<div class="post-metadata">

**Author:** ![wottpal](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/wottpal/32/4439_2.png) [@wottpal](https://forum.getkirby.com/u/wottpal)\
**Post date:** [June 8, 2017, 1:58pm UTC](https://forum.getkirby.com/t/global-field-definitions-for-i-e-files-field-in-blueprints/7683/3 "2017-06-08T13:58:05Z")

</div>

whoa, this was fast.

my blueprint where i try to embed

```auto
title: Bildergalerie
pages: false
icon: camera-retro

files:
  sortable: true
  type:
    - image
  size: 12000000
  fields:
    default: images-default

fields:
  title:
    label: Galerie-Titel
    type: text

  subtitle:
    label: Galerie-Beschreibung
    type: textarea
    buttons: false

  info:
    label: Vorschau-Bild
    type: info
    text: >
      Die Bilder in der Liste links können händisch sortiert werden. Das erste wird als Vorschau-Bild für die Galerie genutzt.

```

`images-default.yaml` under blueprints/fields

```auto
title:
  label: Titel
  type: text
  required: false
  validate:
    maxLength: 80
caption:
  label: Beschreibung
  type: textarea
  buttons: false
keywords:
  label: Schlagwörter
  type: tags
sourceName:
  label: Quelle ©
  type: text
  help: z.B. Name d. Fotografen
sourceLink:
  label: Quellen-Link
  type: url

```

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [June 8, 2017, 2:00pm UTC](https://forum.getkirby.com/t/global-field-definitions-for-i-e-files-field-in-blueprints/7683/4 "2017-06-08T14:00:25Z")

</div>

Oh, you can’t use multiple fields in one file.

---

<div class="post-metadata">

**Author:** ![wottpal](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/wottpal/32/4439_2.png) [@wottpal](https://forum.getkirby.com/u/wottpal)\
**Post date:** [June 8, 2017, 2:01pm UTC](https://forum.getkirby.com/t/global-field-definitions-for-i-e-files-field-in-blueprints/7683/5 "2017-06-08T14:01:56Z")

</div>

You are right, total fault on my side. Nonetheless, do you have any idea to optimize my scenario?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [June 8, 2017, 2:22pm UTC](https://forum.getkirby.com/t/global-field-definitions-for-i-e-files-field-in-blueprints/7683/6 "2017-06-08T14:22:23Z")

</div>

What do you mean with optimize? You can of course create a field definition for each field. You could also extend some of the fields if they are of the same type, but I’m not so sure that really makes such a big difference.

---

<div class="post-metadata">

**Author:** ![Surkiin](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@Surkiin](https://forum.getkirby.com/u/Surkiin)\
**Post date:** [October 5, 2017, 8:47am UTC](https://forum.getkirby.com/t/global-field-definitions-for-i-e-files-field-in-blueprints/7683/7 "2017-10-05T08:47:15Z")

</div>

As i’m having a similar problem: I’m trying standardize metainfo for files to be reused and other blueprints. Unfortunately, what i’m trying doesn’t work. Am I overlooking something? Thanks!

**blueprints/materiaal.yml**

```auto
    title: Materiaal
    pages: true
    fields:
      title:
        label: Titel
        placeholder: Voeg een omschrijvende titel in.
        type: text
      summary:
        label: Inleiding
        placeholder: Schrijf hier inleidende tekst toe. Dit is niet noodzakelijk.
        type: textarea
      text:
        label: Tekst
        placeholder: Schrijf hier een tekst.
        required: true
        type: textarea
        size: large
      coverimg:
        label: Coverafbeelding
        type: image
        width: 1/2
      caption:
        label: Onderschrift coverafbeelding
        type: text
        width: 1/2 
      tags:
        label: tags
        type: tags
    files: metainfo

```

**blueprints/fields/metainfo.yml**

```auto
      fields: 
        title:
          label: Titel
          type: text
        caption:
          label: Onderschrift
          type: textarea
        tags:
          label: Tags
          type: tags
          index: all

```

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [October 5, 2017, 8:50am UTC](https://forum.getkirby.com/t/global-field-definitions-for-i-e-files-field-in-blueprints/7683/8 "2017-10-05T08:50:21Z")

</div>

Please see the documentation for [field groups](https://getkirby.com/docs/panel/blueprints/global-field-definitions/#field-groups) (introduced in Kirby 2.5.0).

---

<div class="post-metadata">

**Author:** ![Surkiin](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@Surkiin](https://forum.getkirby.com/u/Surkiin)\
**Post date:** [October 5, 2017, 9:06am UTC](https://forum.getkirby.com/t/global-field-definitions-for-i-e-files-field-in-blueprints/7683/9 "2017-10-05T09:06:20Z")

</div>

For some reason I was constantly overlooking `type: group`.

Thanks!

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 5:32pm UTC](https://forum.getkirby.com/t/global-field-definitions-for-i-e-files-field-in-blueprints/7683/10 "2025-02-06T17:32:00Z")

</div>


