Forum

Thread tagged as: Question, Addons, Suggestions

Gallery | Template

Hello,

I am trying to use the jQuery Magnific Popup plugin

I have created a new template called "portfolio.html" and changed the images sizes in image.html.

I've then added the below function inside my .php page:

<?php
perch_gallery_build(array(
   'template'=>'portfolio.html' 
));
?>

below is my portfolio.html mark up:

<div class="imageGallery">  <div class="yourPic">
<a class="image-popup-vertical-fit" href="<perch:gallery id="image" type="image" key="small" />">
    <img src="<perch:gallery id="image" type="image" key="main"/>">
</a></div></div>

Once everything has been uploaded, ive then added my images to the galley app in the back-office, but all I get on the home page is:

  <div class="imageGallery">  <div class="yourPic">
<a class="image-popup-vertical-fit" href="">
    <img src="">
</a></div></div>

the html and css work fine but no images appear any ideas on how to resolve this issue, I have watched the gallery video but nothing seems to work for me.

Many Thanks

Gary Thompson

Gary Thompson 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Does perch_gallery_build() return anything sensible with just the default template?

Yes it returns an image within a <ul></ul> which I guess is the standard template.

Ive changed my template.html to:

<div class="imageGallery"> <div class="yourPic"> <a class="image-popup-vertical-fit" href="number-plate-gallery.php?s=<perch:content id="picture" type="image" label="picture" />"> <img src="<perch:content id="smallpicture" type="image" label="smallpicture" />"> </a></div></div>

Ive added a href="number-plate-gallery.php?s= to the template and passed in the template to:

<?php perch_gallery_build(array( 'template'=>'portfolio.html' )); ?>

Im still not having any luck with the images showing I can see perch is passing the template in because it appears in the source code just minus the images.

do I need to a <img src="/admin-login/resources/ to the above code ?

thanks

Drew McLellan

Drew McLellan 2638 points
Perch Support

What are you trying to output? perch_gallery_build() is a bit of an odd one - mainly just to show everything's working.