Populating the Projects page with thumbnails

Hi there! This my seem like a very n00b question but I don’t have much PHP knowledge so I thought I’d ask this simple question here. I’m building an artist website and I’d like to have the Projects page be populated with thumbnails of images that I’ve uploaded to the corresponding folder. How do I go about doing this? I checked out the thumbnail page of the documentation but I have zero idea where I should be putting in the code. surely it can’t be the template file because then I’d have to edit that whenever I upload new images?

Also would it be possible to have the image open up to display a larger version in the same page (not linked to open a page) without the use of a plugin?

Thanks for any help!

Yes, the thumbnail code goes into the template file. If you want to output all images that are uploaded to that folder, then all you have to do is loop through all images, so that new images added later are automatically displayed in the page.

If you want to select those images first, you would have to use a field in your blueprint. But then again, all you would have to do is add to that selection in the panel field, the output would again be automatic.

An example:

<?php
// fetch all images in the projects folder
$images = page('projects')->images();

// loop through all images
foreach($images as $image): ?>
<!-- create a thumbnail of the image -->
<img src="<?php echo $image->resize(200)->url()">
<?php endforeach ?>

You don’t necessarily need a plugin to open a larger version of the image. You can do that with a bit of javascript.