Hi,
i'm new to processwire and programming in general.
i'm trying to select limited no. of images in a page. i guess i would have to use 'limit' in selector but can't get it right.
say i have to get 6 of many image in a page. how do i limit in below code?
plz help!
<?php
$gallery=$page->child("template=gallery_page");
if(!$gallery instanceof NullPage) {
$images = $page->images;
foreach($images as $image){
$thumb = $image->size(194, 111);
echo "<div class='photo'> <a href='{$page->url}gallery' title='$image->description'><img src='$thumb->url' alt='$image->description' width='$thumb->width' height='$thumb->height' /></a> </div>";
}
}
?>