Hi, I been having a bit of trouble with displaying the slider with my own existing picture objects - feeling a bit confused at the moment. I current have a many to many relationship one TestimonialPage having several TestimonialPhotos
private static $many_many = array (
'TestimonialPhotos' => 'Image'
);
and a private function in the controller to get the pictures ..
public function testimonialSlider() {
$testimonialSlider = new FlexSlider();
$testimonialSlider->ID = "allTestimonialImages";
//$testimonialSlider->setDatalist(TestimonialPhotos::get());
//Debug::Show("Start");
//Debug::Show(TestimonialPage::get()->filter('TestimonialPhotos.ID', '30'));
$temp = TestimonialPage::get();
$testimonialSlider->setDatalist = $temp;
$testimonialSlider->setFieldMapping(array(
"Picture" => "TestimonialPhotos", // Not sure what this needs to map to. Is this correct ???
//"Title" => "Created",
"Description" => "Name",
"InternalLink" => "Filename" // Not sure what this needs to map to. Is this correct ???
));
// optional
$testimonialSlider->setImageWidth(119);
// optional
$testimonialSlider->setImageHeight(100);
// optional
$testimonialSlider->setOptions(array(
"animation" => "slide",
"easing" => "linear",
"direction" => "horizontal",
"reverse" => 0,
"animationLoop" => 0,
"slideshow" => 0,
"slideshowSpeed" => 7000,
"animationSpeed" => 400,
"randomize" => 0,
"showControlNav" => 1
));
// optional
$testimonialSlider->addExtraClass("employees");
Debug::Show($testimonialSlider);
return $testimonialSlider;
}
Anyway, I placed the $testimonialSlider in my template and never seem to get any results. Could someone put me in the right direction?
Thanks
P.S. working with SS 3.1