I tried to do something with it but I don't quite understand the templates that we use. Adding php code to the index.tpl just prints out the php code in the footer.
I read elsewhere on this forum that was intentional after version 1.6
From what I understand I need to add the code into the index.php and then reference it in the index.tpl but I'm not sure how to do that.
Any help would be appreciated.
Here is the php that calls the file with the text.
Code: Select all
div id="testimonials">
<ul>
<?php
$xmlFile = '../testimonials/testimonials.xml';
$xslFile = '../testimonials/transformations.xml';
$doc = new DOMDocument();
$xsl = new XSLTProcessor();
$doc->load($xslFile);
$xsl->importStyleSheet($doc);
$doc->load($xmlFile);
echo $xsl->transformToXML($doc);
?>
</ul>
</div>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script src="js/script.js"></script>
Code: Select all
$(document).ready(function(){
// Hiding all the testimonials, except for the first one.
$('#testimonials li').hide().eq(0).show();
// A self executing named function that loops through the testimonials:
(function showNextTestimonial(){
// Wait for 7.5 seconds and hide the currently visible testimonial:
$('#testimonials li:visible').delay(3500).fadeOut('slow',function(){
// Move it to the back:
$(this).appendTo('#testimonials ul');
// Show the next testimonial:
$('#testimonials li:first').fadeIn('slow',function(){
// Call the function again:
showNextTestimonial();
});
});
})();
});