I have applied the following to be displayed beneath the thumbnails for albums on the index page:
``
which does as it's expected and returns something like "(23 images)", so that's working fine. What I'm wondering is how to do something that checks to see if there's sub-albums and returns the number of those - or even total of images contained within them. currently I just get a "0 images" on the index page if any sub-albums are in next level.
Is there a php way to do something along the lines of 'if no images are present state number of sub-albums instead' ?
Hi, thanks very much for that, that's the sort of thing I was after - an if/else bit of code. I added it as required but first attempt came up an error so I scanned where the function came from on the template-functions file and I was able to adapt it further to count the subalbums:
`
if(getNumImages() == 0) {
echo count($_zp_current_album->getSubalbums()).' albums';
} else {
echo "(".getNumImages()." images)";
}
`
Works brilliantly!
If anyone else out there wants, it there you go