Image metadata: order of navigation

, ,

Very specific problem from the real world:

  • My client adds a bunch of photos to a “gallery” within a “structured blocks” field.
  • He re-arranges the order of the images via drag and drop.
  • Now he wants to add captions to each image. He starts with the first one, enters the file metadata layer (with the dark background.) Fine!
  • Now he uses the navigation arrows to go to the next image
  • The order of the navigation does not respect the new manual image order, instead it is ordered alphabetically and show images from other galleries on that page, too.

Is there a way to add captions to the images of a gallery within this very gallery block? Do I have to build my own Vue component for the panel?

Correct, the navigation cannot possibly know of the order in your blocks.

An alternative would be to extend the gallery block in a way that you get a caption for each image, maybe using a structure within the block. And then a custom Vue component if you need a preview other than that of type fields.

Downside of this approach: If an image is used more than once, you’d have to add captions multiple times because they are not attached to the image.

Would this tutorial help me with customizing the existing gallery block or even clone and build my own “supergallery” block?