Hi I've been working with Kirby. I'm a complete beginner in PHP but managed to get a lot done. Just need some help with the gallery.
On the homepage a single image is displayed as thumbnail:
<?php foreach($articles as $article): ?>
<li class="<?php foreach(str::split($article->tags()) as $tag): ?><?php echo $tag ?> <?php endforeach ?>">
<a href="<?php echo $article->url() ?>" title="<?php echo html($article->title()) ?>"><?php foreach($article->images() as $image): ?><?php echo thumb($image, array('width' => 300, 'quality' => 70)) ?><?php endforeach ?><p><?php echo html($article->title()) ?></p></a>
</li>
<?php endforeach ?>
On the article page I'd like to have a gallery. The gallery snippet:
<?php if($page->hasImages()): ?>
<ul class="gallery">
<?php foreach($page->images() as $image): ?>
<li>
<a href="<?php echo $image->url() ?>"><img src="<?php echo $image->url() ?>" width="<?php echo $image->width() ?>" height="<?php echo $image->height() ?>" alt="<?php echo $image->name() ?>" /></a>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
Using Kirby, makes me store all the article items in one folder. But if I do this, and use the code mentioned above, all the images from the gallery also show up as thumbnails on the homepage. I guess the best would be to edit the gallery snippet so it can grab images from a subfolder. But how?
Thank you for your help!