about Photogallery block

Status: 
Solved
Question: 

How to make photogallery block show only newest 8 pictures on profile and rest on photogallery page.......I follow your ebook to make Photogallery block and put it on user profile...in your ebook you only allow like 10 picture to be uploaded to server...I chose unlimited upload instead. there is problem, because photogallery block get too long in profile when too many pictures being unloaded and so are the videogallery block...O.O so how can I show only newest 8 picture and video on profile and rest on Photogallery page and videogallery page?

Responses

1. Hi, If your gallery is being

Hi,

If your gallery is being displayed as a contemplate, you need to change the code:

<?php foreach ((array)$node->field_pictures as $item) { ?>
<?php print $item['view'] ?>
<?php } ?>

to use another type of loop. Something like:

$i=1;
while ($i<=8 )
{
//do the thing...
$i++
}