ideas icon indicating copy to clipboard operation
ideas copied to clipboard

Better handling of inline bard images

Open robdekort opened this issue 3 years ago • 5 comments

I recently had to use a bard inline image (with the image button) because of a design choice. It would be nice if we could hook into what it actually outputs. The things I was missing:

  • An actual picture element with a definable srcset and sizes.
  • Use the alt text you set in the asset library
  • The ability to add classes.

Most flexible would be if you could template this out yourself in Antlers somehow.

robdekort avatar Mar 29 '21 19:03 robdekort

And captions... đŸ‘€ output as figcaption tags... inside a figure tag...

j3ll3yfi5h avatar Sep 12 '22 20:09 j3ll3yfi5h

And prevent other file types than images...

j3ll3yfi5h avatar Sep 14 '22 12:09 j3ll3yfi5h

You could try using https://statamic.com/addons/jacksleight/bard-mutator to change images into whatever html you want.

jasonvarga avatar Sep 14 '22 14:09 jasonvarga

Unfortunately too late: I migrated yesterday a lot of content by hand from bard image to a bard set with image to get the desired result. (Which, fortunately, solved this problem too)

I only left my insights here, if somebody one day improves the behavior of the image to prevent people from beeing frustrated... :)

j3ll3yfi5h avatar Sep 14 '22 14:09 j3ll3yfi5h

My comment was more directed at the the original idea, sorry.

jasonvarga avatar Sep 14 '22 16:09 jasonvarga

Closing as it's quite simple using the Bard Mutator addon. There's even an example in the docs about how to change to picture elements:

https://jacksleight.dev/docs/bard-mutator/examples#render-all-images-with-a-custom-view-partial

jasonvarga avatar Feb 23 '24 19:02 jasonvarga