How do I list all images in a page

Hi I’m trying to show all images from 3 pages, each column in the attached screen shot is 1 page.
The code I have (below) shows only the first image - the title (in red) should appear once at the top of each column.

<?= $page->text() ?>
  <ul class="paintings">
	<?php foreach ($page->children()->listed() as $painting): ?>
	  	  <li>
	      <?= $painting->title() ?>
 	    <a href="<?= $painting->url() ?>">
   	    	  <?= $painting->image()->crop(500) ?>
	    </a> 
	    </li>
	    <?php endforeach ?> 	
  </ul>

Thanks for your help

To show all images of a page, you would need to loop through all images:

<?= $page->text() ?>
  <ul class="paintings">
	<?php foreach ($page->children()->listed() as $painting): ?>
	  	  <li>
	      <?= $painting->title() ?>
 	    <a href="<?= $painting->url() ?>">
                  <?php 
                        $images = $painting->images();
                        foreach ($images as $image) : ?>
   	    	           <?= $image->crop(500) ?>
                        <?php endforeach ?>
	    </a> 
	    </li>
	    <?php endforeach ?> 	
  </ul>

Adjust markup as needed.

Thanks that’s perfect.
Just like to say that in my opinion one of the deciding factors for the success or failure of any cms is the support, and I’m sure your support plays a big part in the success of Kirby - I sure wouldn’t still be learning Kirby if you weren’t there.

1 Like