I want to transfer my existing websites to Grav so that other authors can easily edit content without any knowledge of the syntax and semantics of programming languages.
A problem I haven’t been able to solve yet: How can I ensure that inserting an image during editing generates more than just the usual img tag?
Example: I currently have images automatically tagged with the copyright and image description from the EXIF/IPTC data. After installing the “Admin Addon Media Metadata” plugin and “system.yaml → media.auto_metadata_exif: true,” this works explicitly when written into a template:
<div class="crbild center">
<div>
{% set obild = page.media[bild] %} {# “bild” is taken from header.media_order or the files in user/pages #}
{{ obild.cropResize(500,500).quality(100).html()|raw }}
{% if obild[“copyright”] %}
{% set foto = “© ” ~ obild[“copyright”] %}
{% elseif obild[“author”] %}
{% set foto = “Photo: ” ~ obild[“author”] %}
{% endif %}
<div>{{ foto }}</div>
</div>
{{ obild[“caption”] }}
</div>
and the corresponding CSS:
.crbild >div {
position: relative;
>div {
position: absolute;
right:0.5em;
bottom:0.25em;
color:rgb(200 200 200);
text-shadow:0.1em 0.1em rgb(50 50 50); }}
How can I ensure that such an entry is automatically generated when inserting an image with the admin editor? It would also be nice if you could configure additional image settings in the pop-up window when inserting images in the editor.
I prefer the TinyMCE editor, perhaps an extension of the “image” plugin (tinymce/plugins/image) is possible there. But I haven’t found such options for Grav’s standardized Markdown editor either.
This here is just a simplified example. I do even more with the images: burning in watermarks, foil against unauthorized copying, etc.
All of this should then be possible using only the “insert image” editor function and the corresponding pop-up.