Forum

Thread tagged as: Question, Gallery

perch Album in Variable?

I'm to work with "photosets" in Perch. With the JS I'm using I need a simple setup like this:

<div class="project-photoset" data-layout="123">
     <!-- images go here -->
</div>

I need the photosets in perch:content and perch:blog. I was planning to use perch repeaters for the images, but they are not available in the blog app.

Now I'm wanting to work with the Gallery app.

My blog and content regions are most easily/cleanly made if the set of images, or album, is in the content or blog post template.

I'm wondering if it is possible/advisable to use php to retrieve the album output, storing it in a variable, then passing that variable to a template with something like PerchSystem::set_var('images', $albumImages); ?

Does this make sense? Thanks again!

Nicholas Nelson

Nicholas Nelson 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, that would work. You can use perch_gallery_album_images() to get the images

https://docs.grabaperch.com/addons/gallery/page-functions/perch-gallery-album-images/