New mediapicker field from v1.5.0-rc.3

Hi

Can i have some explanation about New mediapicker field changelog v1.5.0-rc.3
before i use filepicker

how can i retrieve mime or filename with the new mediapicker ?

Thanks

Going to note down the fact that we need to document it. In the meantime, here’s an example of how it’s used:

header.image:
  type: mediapicker
  folder: 'self@'
  label: Select a file
  preview_images: true
  accept:
    - .jpg

It stores the path to the file, even if it’s in another page. Then to use:

{% set image_parts = pathinfo(spread.image) %}
{% set image_basename = image_parts.basename %}
{% set image_page = image_parts.dirname == '.' ? page : page.find(image_parts.dirname) %}

{{ image_page.media[image_basename].html() }}
2 Likes

thanks, that’s it
new mediapicker field is really great

I’m late to the topic, but… AWESOME!

I tried GRAV out for the first time a couple of months ago. GRAV already performed really well in comparison to most other CMS even back then, but it lacking a good media manager was a big problem for me. With this new field type, GRAV shot to the top of my list.

If the ability to ‘localize’ form fields gets added at some point, GRAV will beat 95% of all other systems out there, no contest.

@rhuk you added preview_images to your blueprint, will this be supported?