Forum

Thread tagged as: Problem, Gallery

Problem getting the gallery album field type to work

I am trying to add the album field type into the page type so that it pulls back a basic thumbnail gallery however it doesn't seem to work.

I am trying to have a custom template that pulls in the album that I have assigned. I put the template in the template>content folder and also template>gallery folders.

this works

<?php
    $album = perch_content_custom('Image Album', array('skip-template'=>true));
    if (is_array($album)) {
        // ['album'] is the ID of the field to get the slug from
        $albumSlug = $album[0]['album']; 
        perch_gallery_album($albumSlug);
    }

But this doesn't when I try to assign the template for styling and changing thumbnail settings.

<?php
$album = perch_content_custom('Image Album');
if (is_array($album)) {
    // ['album'] is the ID of the field to get the slug from
    $albumSlug = $album[0]['album']; 
    perch_gallery_album_images($albumSlug, array('template'=> 'twocol-basic-gallery.html'));
}
?>
Andrew Cetnarskyj

Andrew Cetnarskyj 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

This:

$album = perch_content_custom('Image Album');

should be:

$album = perch_content_custom('Image Album', array('skip-template'=>true));

like the first example

Doh, stupid missed that.

Thanks