Forum

Thread tagged as: Question, Gallery

How do I check if an album exists in the Gallery app?

I'd like to output some markup if an album with a specific slug exists in a PHP file.

The logic would be like this:

If an album with slug name of "x" exists then output y.

I'm pretty sure this is possible but not sure how to do it. Any help would be appreciated.

Jay George

Jay George 2 points

  • 4 years ago

I think I've answered my own question for anyone looking for something similar:

$album_exists = perch_gallery_album_details("name-of-album");

if ($album_exists !== false) {
    echo "the album exists";
} else {
    echo "the album does not exist";
}
Drew McLellan

Drew McLellan 2638 points
Perch Support

Looks good to me.