One Slideshow per project

Hi, i’m working on a web portfolio right new and decided to use kirby, so i’m pretty new to all the php language.

So this would be the structure of the site :

The home page is showing the first images of each projets, then if you click on one project,
a slideshow would appear to show the rest of the images of the project you cliked.

I know that structure comprehension for kirby is the key but i read topics on slideshow issues and i didn’t found a solution,I didn’t understand all the kirby/php logic yet

For now, i have succeeded to display the home page with the first images of each projet like this :

  <ul class="projects-wrap">
    <?php foreach($page->children()->listed() as $home): ?>
        <a href="<?= $home->url()?>">

         <figure class="slide" >
           <?= $home->image()->crop(750,1000)?>

    <?php endforeach?>

And the structure folder is “content/home/project-1/1.jpg” (for one project)
But now i’m wondering if i have to separate the preview image to the rest of the images for each project, or the keep them in one folder and just call the right now with php…

I will take any advice or help,


You can exclude the image from the rest of the images if you don’t want the preview image in your slider.

// get all but the first image
$images = $home->images()->not($home->image());

But how in the folder i separate the preview image from the other ones ?

There are at least two ways to achieve this:

  1. Create a separate files section to which you assign a different template, then you can filter images by this template
  2. Create a files field in addition to the files section, where you select the preview image, then use this to exclude this image from the rest.
1 Like

ok nice, thanks for the help!!