Displaying all images but in the order I want

I can display all the images within a page folder:

				<?php foreach($page->images() as $file): ?>
					<img src="<?= $file->url() ?>">
				<?php endforeach ?>

But how can I also display the caption?

And display the images in the order of my choosing?

The problem is that you are seemingly doing all this in an editor instead of through the Panel. The Panel would automatically create a meta data file for you and you could sort files in the Panel and a sorting number would automatically be put into this meta data file. You could then sort by this sorting number.

In your editor, you have to do this manually:

  1. Create a meta data file for each image (Files | Kirby CMS)
  2. Add a sort field
  3. Add number to this sort field
  4. Sort by this field

BTW: This is all in the documentation

Oh, okay, I’m working my way through the Kirby videos and haven’t got to the Panel yet!

So in the Panel I can choose to show all the images associated with that page? And put them in order? Clever stuff.

I’ll have a look at the panel as soon as I can

Yes, it needs some work to set up, so not too much stuff at the same time. But once you get it, you will love the flexibility (thinking about your clients, but I think you have already seen this in action, given that you worked with a dev on a Kirby project?).

Urm, I’ve just opened the Panel and I can’t even see my child case study pages. I’m loosing the will to carry on…

I haven’t worked with a dev on a Kirby project. I dabbled with Kirby a few months ago, but gave up. I really like the look of Kirby and may at some point have enquired about bringing in a Kirby expert to work with me on a project