Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Custom blueprint `type: pagemedia` allowed filetypes

Started by Sebastian 8 years ago · 1 replies · 1146 views
8 years ago

Hey guys,

I'm using custom blueprints for my pages in grav admin and noticed that if using type: pagemedia for organizing media files, there is now way to set which files are allowed for uploading, like it works with type: file

YAML
type: file
accept:
  - 'image/*'

Have my blueprint as example.

YAML
title: Media

form:
  fields:
    tabs:
      type: tabs
      active: 1

      fields:
        gallery:
          type: tab
          title: Media Verwaltung

          fields:
            fileupload:
              type: file
              label: Bild hochladen
              destination: 'page@:/media'
              multiple: true
              limit: 10
              avoid_overwriting: true
              filesize: 5
              accept:
                - 'image/*'
                - 'video/*'
                - '.pdf'
            mediaOrganizr:
              label: Datein verwalten, hochladen, löschen
              type: pagemedia
              ## NOT WORKING ##
              accept:
                - 'image/*'
                - 'video/*'
                - '.pdf'

So is there a way of limiting the upload or the allowed filetypes at all?

Also I found out that in pagemedia.html.twig on line 25
{% set uploadLimit = grav.config.system.media.upload_limit / 1024 / 1024 %} .media.upload_limit is never set on default in the system.yaml?

Could need some help here 🙂

Cheers

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by Anna, 2 days ago
2 53 16 hours ago
Forms & Blueprints · by Anna, 3 days ago
7 82 16 hours ago
Forms & Blueprints · by Anna, 1 week ago
5 186 6 days ago
Forms & Blueprints · by TomW, 1 month ago
3 379 1 month ago
Forms & Blueprints · by Japhy, 2 months ago
2 595 2 months ago