Displaying image from photo album (folder of images) within a template

Im full of beer and chinese food at this point in the evening so im stuggling to explain :slight_smile:

bascially you run into the next and previous links linking to the wrong image if you reorder the files because then it is out of sync with the virtual page numbering… am i making sense?

But as long as I don’t reorder the images in the panel, just keep the original order?

Model:

 public function children()
    {
        $images = [];

        foreach ($this->images() as $image) {

          $images[] = [
              'slug'     => $image->name(),
              'num'      => $image->sort()->isNotEmpty() ? $image->sort()->value() : null,
              'template' => 'image',
              'model'    => 'image',
              'content'  => [
                 'sort' => $image()->sort(),
              ]
          ];
        }

        return Pages::factory($images, $this);
    }

Controller:

    $gallery = $page->children()->sortBy('sort');

Prev-next

<?php 
$siblings = $page->siblings()->sortBy('sort');
if ($page->hasNext($siblings): ?>
		<a href="<?= $page->next($siblings)->url() ?>" aria-label="Next">→</a>
		<?php else: ?>

		<span>→</span>
	<?php endif ?>

That would be good… :slight_smile: … if you can add the ability to do this and make a real sub page too, that would be awesome. Right now, you cant with this setup.