How to add a project cover but skip the cover in the gallery?

Hi,
yet another question about the redesign of my photography magazine.

I’m using a template (issue.php) that shows the editorial and the projects for that issue. I list al the projects related to the issue with this snippet:

  <ul class="responsive-thumbnails" data-max-width="300px" data-max-height="300px" data-padding="10px">
    <?php foreach($page->children()->find('projects')->children() as $subpage): ?>  
      <li>
        <a href="<?php echo $subpage->url() ?>">
          <?php if($image = $subpage->image()): ?>
             <?php echo thumb($subpage->image(), array('width' => 300, 'height' => 200, 'crop' => true)); ?>
          <?php endif ?>
        </a>
        <div class="metadata">
          <strong class="project_author"><?php echo html($subpage->author()) ?></strong>
          <span class="project_title"><?php echo html($subpage->title()) ?></span>
        </div>
      </li>
    <?php endforeach ?>
  </ul>

Currently the folder has the following structure:

Then when I click on a project, the project.php render the project folder with fotorama and I use this snippet of code:

  <div class="fotorama"
  data-width="100%"
  data-ratio="4/3"
  data-allowfullscreen="native"
  data-arrows="true"
  data-click="true"
  data-swipe="true"
  data-keyboard="true"
  data-transition="crossfade"
  data-hash="true"
  >

  <?php if($page->image('video.jpg')): ?>
    <a href="<?= $page->VideoUrl() ?>">Video</a>
  <?php else: ?>
    <?php foreach($page->images()->sortBy('sort', 'asc') as $image): ?>
      <img src="<?= $image->url() ?>" 
      data-caption="<?= html($image->caption()->kirbytext()) ?>" 
      data-full="<?= $site->url() . '/content/' . $page->diruri(). "/full/" . $image->filename(); ?>" >
    <?php endforeach ?>
  <?php endif ?>
</div>

I want to editorially manage the cover of the projects, so I’d like to put a cover.jpg inside each folder, and show the cover in the issue.php template but I don’t want to show the cover in the fotorama slideshow.

Which is the best strategy to do this? Can I modify the above snippets or I need to redefine the folder structure (hope no, otherwise I need to re upload 5gb of data :frowning: )

Thanks in advance!

not() should solve your problem … https://getkirby.com/docs/cheatsheet/files/not

<?php foreach($page->images()->not('cover.jpg')->sortBy('sort', 'asc') as $image): ?>

Genius! Thanks :blush: