I’m creating a website for a client and i would like he could insert the image caption in the image preview.
i know how to recover the metadata info if i create the code, but the function $page->text()->kirbytext() recover all the information in the text box from the panel by itself.
There is any way to tell the template if the image has the metadata filled include the content in the page?
PD. I know user can insert caption this way (image: crafting-type-sg_06-600x260.jpg caption: ‘bla’), but i prefer the panel option if it’s possible.
Not exactly. The way you propose is perfect if I insert the code to include images. My problem is that all the contents (paragraphs, images, list,…) are inserted by the $page->text()->kirbytext() function. So i don’t know how to include extra code to this function.
And i don’t know how to include the elements in order if i don’t use this function. I mean sometimes images are between paragraphs. If i include all the paragraphs and then all the images they are going to be disorded.
There’s always a risk that something breaks if you update, but as long as you copied the tag into /site/tags and did not change the source code, you are fairly safe.
Well, then your changes will get overwritten as soon as you update. All you need to do, is copy the image tag bit into a separate file and save it as image.php in /site/tags.