Files or Assets Overview in Page

Kirby v2 used to have an assets overview directly inside each page blueprint / template (to edit, delete or rename images).
From what I’ve found in the docs there’s a predefined section you can add easily. Basically this works like a charm, unfortunately I have to add all assets / images manually to said overview for every page the client has already created.

Just like this:

Files: # a files section
        type: files
        template: gallery-image
        layout: cards
        size: tiny

Is there no easy way to add the assets overview such as in v2 quickly?

Thanks and apologies if I am missing something.

If you don’t filter by template, all files will show up. If you want to stick with a template, then it would make sense to programmatically add the template to all relevant files.

Thank you for your quick response, appreciated. Tried this before and did not make any difference. Still have to add the files manually to that overview…

What did you try that did not work? Could you post the complete blueprint, please.

If I define a preset (“page”) for the blueprint it does show all the files though — as I already have set up multiple tabs I don’t wanna rebuild that.

Or can’t it be using a files section inside a tab?
(The files section is showing up, it just says “Keine Dateien ausgewählt”)

Thanks @texnixe

Here’s the whole blueprint:

title: Project

tabs:

  info:
    label: Projekt-Info
    icon: text

    fields: 
      
      created_at:
        label: Projekt erstellt am
        type: date
        time: true
        default: now
        width: 1/3

      category:
        label: Kategorie
        type: select
        required: true
        default: personal
        options:
          personal: Personal
          commissioned: Commissioned
        width: 1/3

      period:
        label: Zeitraum
        type: text
        width: 1/3
        placeholder: zB "2013 - 2017"

      description:
        label: Beschreibung
        type: text



  # Teaser Images Tab

  teaser:
    label: Teaser Images
    icon: image

    fields:

      local_shuffle_mode:
        label: Shuffle Mode für dieses Projekt
        type: toggle
        text:
          - Shuffle Mode aus
          - Shuffle Mode ein
        help: Ist der Shuffle Mode aktiv, werden aus allen Bildern dieses Projekts bis zu 6 Bilder in zufälliger Auswahl und Reihenfolge angezeigt. Bitte beachten — Ist in "Home" der global Shuffle Mode aktiviert, wird diese Einstellung ignoriert. Nachfolgend gewählte Teaser Images werden nur angezeigt, wenn diese Shuffle Mode Option deaktiviert ist.

      teaser_images:
        label: Teaser Bilder zur Anzeige in der Übersicht (Home)
        type: structure
        help: Es muss mindestens ein Bild gewählt werden, maximal möglich sind sechs Bilder.
        min: 1
        max: 6
        when: 
          local_shuffle_mode: false
        fields:
          image_file:
            label: Bild
            type: files
            width: 1/2
            required: true
          image_description:
            label: Beschreibung
            type: text
            width: 1/2
            required: true


  # Slides Tab

  slides:
    label: Slides
    icon: image

    sections: 

      fields:
        type: fields

        fields:
          project_slides:
              label: Projekt Slides
              type: structure
              fields:
                first_image:
                  label: Erstes Bild (File)
                  type: files
                  required: true
                  width: 1/2
                first_image_title:
                  label: Erstes Bild (Titel)
                  type: text
                  width: 1/2
                second_image:
                  label: Zweites Bild (File)
                  type: files
                  width: 1/2
                second_image_title:
                  label: Zweites Bild (Titel)
                  type: text
                  width: 1/2


          Files: # a files section
            type: files
            layout: list

Oh sorry… broke the indention now. Again the files section is showing up but not displaying any files.

  1. Yes, there are files inside this page.
  2. I make use of a structure field to set up a slider. The client has already uploaded images via the integrated upload functionality inside the structure field. Could the files not being display caused by that?

You can use sections inside tabs, yes.
But what you defined there is not a section but a files field, because the indentation is wrong, it has to be on the same indent level as fields section to make it a section (indent 6 spaces).

  # Slides Tab

  slides:
    label: Slides
    icon: image

    sections:

      fields:
        type: fields

        fields:
          project_slides:
              label: Projekt Slides
              type: structure
              fields:
                first_image:
                  label: Erstes Bild (File)
                  type: files
                  required: true
                  width: 1/2
                first_image_title:
                  label: Erstes Bild (Titel)
                  type: text
                  width: 1/2
                second_image:
                  label: Zweites Bild (File)
                  type: files
                  width: 1/2
                second_image_title:
                  label: Zweites Bild (Titel)
                  type: text
                  width: 1/2


      Files: # a files section
        type: files
        layout: list

Oh wow, thank you so much. Works like a charm now, sorry for bothering you with something so basic.

Moved it to a new tab now, everything’s perfect.

Thanks again.

Don’t worry, indentation can be a bit of a pain in long blueprints.

1 Like