Jump to content

Echo image array within a repeater


Peter Knight
 Share

Recommended Posts

I have 2 repeater types working with the Repeater Matrix.

To keep things simple, I have

  1. image gallery
  2. a downloads gallery.

I can't quite figure out how to echo the contents from within a product_gallery. 

I can get the code below to display the text 'An image gallery' but not the bunch of images within this.

I'm not sure though if it's my variable trail or my nested echo statement.

 

<?php
foreach($page->components as $item) {
  if($item->type == 'product_gallery') {
    echo " An image gallery...";

        foreach($product_gallery->images as $photo) {
        echo "
	An image
	<image src='{$photo->url}'>
        ";
            }
    }
       


    else if($item->type == 'downloads') {
        echo "
         A download gallery...
          ";
     
    }
}
?>

Thanks

P

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...