17452 Posts in 4473 Topics by 1971 members
|Go to End|
31 August 2008 at 4:28am
I'm planning to hack the Gallery module to optionally use the Simpleviewer flash gallery. The one thing I'm struggling with is the xml file for SV.
If I add a new function within gallerypage.php to generate the code, how/when/where do I call the function? I'm thinking it should generate the xml when it creates the thumbnails. I'm looking at adding it to GalleryItems(). SV pagenates, so prev,next would be unused.
I'm lightly seasoned in PHP, and by no means an expert (more familiar with procedural, not OOP). Any help, insight would be appreciated. Thanks!
31 August 2008 at 4:49am
Hi Ben and welcome !
I donÃ‚Â´t know Simpleviewer , but I understand it needs an XML file containing the filenames and captions, right ?
My guess is you'd have to create a new template (within the gallery module) to create the XML file and feed it with the image-data.
I'll have a more detailed look later , because I'd like to add Piclens support to the gallery.
Good luck !
31 August 2008 at 11:22am Last edited: 31 August 2008 11:55am
I have pretty much everything working now, except this:
I have a function buildGallery() that creates all the thumbnails, generates the xml file and is supposed to return the xml file's path. But when the template is processed, nothing inside the control block appears. (but the function runs correctly, everything is created)
Any idea what could be wrong?
I'm sure I'm doing it wrong, I don't really get OOP.
<% control buildGallery %>
var fo = new SWFObject("viewer.swf", "viewer", "100%", "100%", "8", "#181818");
// SIMPLEVIEWER CONFIGURATION OPTIONS
// To use an option, uncomment it by removing the "//" at the start of the line
// For a description of config options, go to:
//fo.addVariable("langOpenImage", "Open Image in New Window");
<% end_control %>
31 August 2008 at 2:34pm
The buildGallery returns what? You probably dont need to put that JS in the control syntax as the control syntax is pretty much a foreach loop. If your buildGallery just returns $path then what you need to do is remove the control loop and just have $buildGallery where $path is. Then having $buildGallery it will call buildGallery() and go off and do its thing and then return the path.
If you need some ideas on flash + xml + gallery integration I just did I slideshowpro version for a client - http://open.silverstripe.com/browser/modules/slideshowpro/trunk/
31 August 2008 at 3:54pm
Oh, yes that's so obvious, I will give it a try, thanks! I didn't think the control loop really made sense...
|Go to Top|