Forum
Adding a gallery to a template
I have a custom template that until now I have been using the <perch:repeater>
tag in order to create a gallery of images. However, I am often dealing with galleries of around 50 images, so the standard Asset management is getting a bit cumbersome and cluttered, so I wanted to use the perch gallery plugin to declutter the process. However, it seems that the gallery can only be implemented in a PHP file with the PHP functions. This obviously doesn't work with the content templates which are plain old HTML.
Is there any way to work around this issue?
Thanks in advance.
I've done this exact thing in a project before (though I don't have the code to hand). I did it by creating a text field in the template that would expect a gallery slug(s). I would then create an array using
perch_content_custom
to get the slugs and then use theperch_gallery_album_images
function to show the galleries.Sorry I don't have code for you but hopefully that will give you a start.
You can use the albumlist field type that comes with the Gallery. Will that help?