title: Ressource
icon: folder

tabs:
  content:
    label: Contenu
    icon: document
    columns:
      intro:
        width: 1/3
        sections:
          introContent:
            type: fields
            fields:
              headline: 
                type: headline
                label: Présentation
                numbered: false
              subtitle:
                label: Sous-titre
                type: text
                help: Optionnel
              headerImage:
                label: Image de vignette
                type: files
                template: image
                multiple: false
                uploads:
                  template: image
              # categories:
              #   label: Catégories
              #   type: tags
              #   accept: options
              #   options: query
              #   query: 
              #     fetch: page.parent.categories.toStructure 
              #     text: "{{ structureItem.main }}"
              #     value: "{{ structureItem.main.slug }}"
              # subCategories:
              #   label: Sous-catégories
              #   type: tags
              #   accept: options
              #   options: query
              #   query:
              #     fetch: kirby.collection('categories')
              #     text: "{{ arrayItem.value }}"
              #     value: "{{ arrayItem.value.slug }}"
              theme:
                label: Thème
                type: tags
                accept: options
                options: query
                query: 
                  fetch: page.parent.themeCat.toStructure 
                  text: "{{ structureItem.categories }}"
                  value: "{{ structureItem.categories }}"
              subject:
                label: Discipline
                type: tags
                accept: options
                options: query
                query: 
                  fetch: page.parent.subjectCat.toStructure 
                  text: "{{ structureItem.categories }}"
                  value: "{{ structureItem.categories }}"
              location:
                label: Lieu
                type: tags
                accept: options
                options: query
                query: 
                  fetch: page.parent.locationCat.toStructure 
                  text: "{{ structureItem.categories }}"
                  value: "{{ structureItem.categories }}"
              related:
                label: Ressources en lien
                type: pages
                query: site.find('resources').children.listed

      pageContent:
        width: 2/3
        sections:
          resourceContent:
            type: fields
            fields:
              intro:
                label: Introduction
                type: textarea
                size: tiny
              headline2: 
                type: headline
                label: Contenu
                numbered: false
              resourceContent:
                label: Sections
                type: structure
                fields:
                  title:
                    label: 
                      fr: Titre principal
                      en: Main title
                    type: text
                  layout: 
                    type: layout
                    extends:
                      - layout/layouts
                      - layout/fieldsets

  files:
    label: Fichiers
    icon: file-image
    sections:
      files:
        label: Fichiers
        type: files
        template: image
        uploads:
          template: image
  metadatas:
    label: Métadonnées
    icon: share
    columns:
      socialContent:
        fields:
          metaTitle:
            label: Titre SEO
            type: text
            maxlength: 160
            width: 1/2
          seoImage:
            label: Image SEO
            type: files
            template: image
            uploads:
              template: image
            multiple: false
            width: 1/2
          description:
            type: text
            maxlength: 160