Jump to content

Repeater for Image Gallery


quickjeff
 Share

Recommended Posts

Hi Guys, 

I'm back with another question. 

Figured I would ask for another set of eyes on this one. 

Basically, the categories are being created if a new gallery is added through the CMS but the images are not showing up. 

Any help would be great!

 <?php 
  
  
  
  //newgallery is the name of the field in the CMS whic is a repeater
 
 //gallery_title is the name of the field in the CMS which is inside the repeater field for the category title.

 //images1 is the name of the field in the CMS which is inside the repeater field for the images gallery
 

  
  
  //THIS IS WHERE THE TITLES ARE BEING DISPLAYED FOR A CERTAIN CATEGORY THE USER MAKES IN THE CMS FOR THE GALLERY
  
  
	  foreach($page->newgallery as $new_gallery) {
    		echo "  <section class=''>
    <p class='title' data-section-title><a href='#panel1'>{$new_gallery->gallery_title}</a></p>
    <div class='content' data-section-content>  
     <ul class='clearing-thumbs' data-clearing>";
     
     
     
    
    
    
    
    //The issue is below!!!!!!!!!! 
     
     
       //THIS IS WHERE THE IMAGES ARE SUPPOSED TO DISPLAY FOR A CREATED CATEGORY, UNDER ITS OWN IMAGE GALLERY, WHICH IS ALSO TIED TO THE REPEATER FIELD

    if (count($page->$new_gallery->images1)) {
        // randomize some images
        $images1 = $page->images1->getRandom(100);
        foreach($images1 as $image1) {
            $thumbnail1 = $image1->size(118,112);
            
            echo "<li><a href='{$image1->url}'><img class='photo' src='{$thumbnail1->url}' style='border:1px #dadada solid;' alt='{$image1->description}' /></a></li> ";
            
            
            
        }
    }
      
    
    
    echo"</ul>
    </div>
  </section>";
    
    
    
    
    
    

     
     }
     

    ?>
Link to comment
Share on other sites

  • 2 weeks later...

<?php

//newgallery is the actually name of the field in the CMS that is a repeater

//images1 is the actually name of the field in the CMS that is inside the repater field for the images gallery

//THIS IS WHERE THE TITLES ARE BEING DISPLAYED FOR A CERTAIN CATEGORY THE USER MAKES IN THE CMS FOR THE GALLERY

foreach($page->newgallery as $new_gallery) {

echo " <section class=''>

<p class='title' data-section-title><a href='#panel1'>{$new_gallery->gallery_title}</a></p>

<div class='content' data-section-content>

<ul class='clearing-thumbs' data-clearing>";

//The issue was solved!!!!!!

//THIS IS WHERE THE IMAGES ARE SUPPOSED TO DISPLAY FROM THAT CATEGORIE IMAGE GALLERY, WHICH IS ALSO TIED TO THE REPEATER FIELD

if (count($new_gallery->images1)) {

// randomize some images

$images1 = $new_gallery->images1->getRandom(100);

foreach($images1 as $image1) {

$thumbnail1 = $image1->size(118,112);

echo "<li><a href='{$image1->url}'><img class='photo' width='118' height='112' src='{$thumbnail1->url}' style='border:1px #dadada solid;' alt='{$image1->description}' /></a></li> ";

}

}

echo"</ul>

</div>

</section>";

}

?>

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...