I have applied the following to be displayed beneath the thumbnails for albums on the index page:
`<?php echo "(".getNumImages()." images)"; ?>`
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' ?
Comments
`
if(getNumImages() == 0) {
echo $_zp_current_album->getNumAlbums().' albums';
} else {
echo "(".getNumImages()." images)";
}
`
To get the number of all images of all subitems you will have to code a little more.
`
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