Pragmatism in code

If you think that the standard JomSocial album cover image that shown for empty albums ruins your nice template you can easily hide all albums with zero photos in them by applying this little mod.


Open the following file: /components/com/community/templates/default/albums.list.php

If you are using a custom JomSocial template you may need to substitute 'default' with the name of your template.


Find the following line (around line 38):

                        CHeadHelper::addOpengraph('og:image', $album->getCoverThumbURI(), true);


Add the following code underneath

//DeeEmm MOD hide covers for albums with no images or no cover image set
if ($album->count == 0 || $album->getCoverThumbURI() == '') {


NOTE: This will hide ALL albums that either contain no images or do not have a cover image set. If you only want to hide albums that contain no images, use the following code instead:

//DeeEmm MOD hide covers for albums with no images
if ($album->count == 0) {