How do I interact with the image field in processwire? For instance, I have a Javascript gallery that takes a certain size image and it's thumbnail to make a browseable gallery. I know PW creates a thumbnail somewhere...but how do I configure the size and access it from the front end?
To interact with the images field. Create a new field (under Setup > Fields) and call it whatever you want, like "images" for example. Set the field type as "image". Add this field to a template (under Setup > Templates). Then edit a page using that template and upload some images.
In your template code:
ProcessWire will create your images at any size on the fly and then keep a cache of them. For instance, lets say we want to cycle through all the images, create a large image at 500 pixel width with proportional height, and a thumbnail at 100x100, and then have the thumbnail link to the large:
<?php
foreach($page->images as $image) {
$large = $image->width(500);
$thumb = $image->size(100, 100);
echo "<a href='{$large->url}'><img src='{$thumb->url}' alt='{$thumb->description}' /></a>";
}













