Generating nivo-slider HTML from XML using PHP or Javascript

  • Thread starter Thread starter R
  • Start date Start date

R

New Member
Im using the jQuery NivoLight, which uses nivo-slider in combination with prettyPhoto lightbox.This is the page that the gallery is on: http://www.kristinemorical.com/design/designsystems/unitedway/unitedway.phpThe XML file is at:http://www.kristinemorical.com/design/designsystems/unitedway/unitedway.xmlI've defined the image, captions and links in a separate XML file like below:\[code\]<images> <pic> <title>Project Title</title> <image>/imagetitle1.jpg</image> <caption>image caption</caption> <thumbnail>/thumbs/imagetitle1.jpg</thumbnail> <link>/imagetitle1.jpg</link> <linkdes>image caption</linkdes> </pic> <pic> <title>Project Title</title> <image>/imagetitle2.jpg</image> <caption>image caption</caption> <thumbnail>/thumbs/imagetitle2.jpg</thumbnail> <link>/imagetitle1.jpg</link> <linkdes>image caption</linkdes> </pic></images>\[/code\]I setup the slider like below:\[code\]<div id="slider-container"> <div class="slider-wrapper theme-kristy"> <div id="slider" class="nivoSlider"> <a href="http://stackoverflow.com/imagetitle1.jpg" rel="prettyPhoto" title="image caption"> <img src="http://stackoverflow.com/imagetitle1.jpg" alt="image caption" title="#htmlcaption1" /> </a> <a href="http://stackoverflow.com/imagetitle2.jpg" rel="prettyPhoto" title="image caption"> <img src="http://stackoverflow.com/imagetitle2.jpg" alt="image caption" title="#htmlcaption2" /> </a> </div> </div></div><div id="htmlcaption1" class="nivo-html-caption"> Project Title<br><span class="caption">image caption</span></div><div id="htmlcaption2" class="nivo-html-caption"> Project Title<br><span class="caption">image caption</span></div>\[/code\]The question is: how can I generate HTML in the same structure a used above with either Javascript or PHP? Would PHP or Javascript work best?but never found out if they figured it out or not and I have a bit different situation.The challenge is that the titles on the image need to say htmlcaption1, htmlcaption2, etc. which matches with the caption ids of htmlcaption1, htmlcaption2, etc. so that the captions can include html in them.
 
Back
Top