Admin Addon Media Metadata Plugin
The Admin plugin has not been offering a feature like this yet. In order to add/edit metadata e.g. for an image you had to create a [image.filename].meta.yaml for the image in your file browser and edit it in a text editor.
Usage and Features
- the plugin will create and edit [mediafile].meta.yaml files in your page folder via a simple form in the Admin plugin
- by default you can add/edit a title, alt text, and a caption – see Configuration section below on how to adapt this for your Grav installation
- multiline text can be added (e.g. for caption)
- in case you are storing additional, manually added data in your [mediafile].meta.yaml file, it will not be overwritten even if the form does not let you change it
How to use it
(see also screenshots below)
- hover any file in your Page Media section
- hit the small «i» button to open the metadata form (the regular «i» button which just showed the metadata will be overwritten by the plugin)
To install the plugin manually, download the ZIP version of this repository and unzip it under
/your/site/grav/user/plugins. Then rename the folder to
admin-addon-media-metadata. You can find these files on GitHub.
I will try and submit the plugin to the Grav repository for installation via Grav’s package manager or via the Admin plugin.
The default fields in the metadata form are alt, title, and caption. If you want to add more data to your meta.yaml files, please copy
and add more form fields to the form by updating the copy. E.g. if you want to add a field for a web link, you might add the following lines:
- type: text label: Web link name: weblink
The URL field will be available in your metadata form and you’ll be able edit the information.
I have based the plugin on Dávid Szabó’s Admin Addon Media Rename plugin. Much of the code would not have been possible for me without Dávid’s work.
@renards helped a lot in replacing my original self-written Yaml parsing and writing code with Grav core technology and thus made version 1.0.0 possible.
- add the possibility for page-specific metadata forms