Topic: Customizing A dynamic instance of simpleviewer

Our website CMS currently has a working instance of simpleviewer 1.9. We have customized it to pull from the CMS generated photo xml feed. http://www.geneva.edu/object/photos_rock_climbing.html

I am trying to implement the latest version of simpleviewer but the new version makes it difficult for customization since you cannot edit the direct path to simpleviewer.swf.

IS there a way to implement the new version of simpleviewer using a direct call to the .swf like ver. 1.9? Simply put I need an "old school" embed option that lets you configure everything in the source.

Re: Customizing A dynamic instance of simpleviewer

Your SimpleViewer v1.9 gallery currently uses the following code:

fo.addVariable("xmlDataPath", "photos_rock_climbing.html?_templateId=211");

You can do likewise with SimpleViewer v2.3.1 using the galleryURL configuiration option, for example:

<!--START SIMPLEVIEWER EMBED.-->
<script type="text/javascript" src="svcore/js/simpleviewer.js"></script>
<script type="text/javascript">
var flashvars={};
flashvars.galleryURL="gallery.php?id=123";
simpleviewer.ready(function () {
simpleviewer.load("sv-container", "100%", "100%", "222222", true, flashvars);
});
</script>
<div id="sv-container"></div>
<!-- END SIMPLEVIEWER EMBED -->

... where the 'gallery.php' file would dynamically construct the gallery's XML file using the 'id' query string.

Steven Speirs
SimpleViewer Support Team.

Re: Customizing A dynamic instance of simpleviewer

Thank you Steven! I will try this out.

Can you also direct me how to set the path to the simpleviewer.swf?

In our CMS, I need to make sure the path is correct or it will not find the file.

Thanks!

Re: Customizing A dynamic instance of simpleviewer

The recommended embedding code above will automatically find and use the SWF file within the 'svcore' folder if Adobe Flash Player is installed and enabled in the user's browser. Otherwise, the gallery will be displayed by the Mobile Player.
You could embed the 'svcore/swf/simpleviewer.swf/' file directly in your page using exactly the same method as you did in v1.9 but your v2.3.1 gallery would no longer support Universal Playback.
Use the recommended embedding code above and you need only specify the path to the 'simpleviewer.js' file (not the SWF file).

Steven Speirs
SimpleViewer Support Team.

Re: Customizing A dynamic instance of simpleviewer

Steven, thank you again for the reply. I have not been able to get it working.
Here is the code I am using:

<script xmlns="" src="http://www.geneva.edu/docs/TEMPLATE/501/swfobject.js" type="text/javascript"></script>
<script xmlns="" src="http://www.geneva.edu/docs/TEMPLATE/501/simpleviewer.js" type="text/javascript"></script>
<script xmlns="" type="text/javascript">
var flashvars={};
flashvars.galleryURL="http://www.geneva.edu/object/photos_rock_climbing_pro?_templateId=505";
     
simpleviewer.ready(function () {
simpleviewer.load("sv-container", "100%", "100%", "222222", true, flashvars);
});

</script>
<div xmlns="" id="sv-container"></div>

Can you kindly show me how to implement the direct call to the simpleviewer.swf into the code above? If I can get the newer version working without universal playback that will at least be temporary success.

And..

The simpleviewer js file is uploaded here:
http://www.geneva.edu/docs/TEMPLATE/501/simpleviewer.js

and the .swf file in the same location:
http://www.geneva.edu/docs/TEMPLATE/501 … viewer.swf

In our CMS, I cannot upload the folder structure that is generated by the svbuilder. I have to establish direct links to the files that I upload into the cms. Is there a way use an uncompiled version of the .js file and hard code the location of the .swf ?

Thanks!

Re: Customizing A dynamic instance of simpleviewer

In order for SimpleViewer v2 to function correctly, the structure of the 'svcore' folder (including all subfolders) should be kept in tact.
If you want to use just the SWF file from SimpleViewer v2, you could embed the SWF file exactly as you did for v1.9. Just swap the v1.9 'simpleviewer.swf' file for the SimpleViewer v2 'simpleviewer.swf' file (from the 'svcore/swf/' folder) on your web server.

If you are unable to upload the complete 'svcore' folder to your web server, then an alternative might be to follow the Embedding in a Web Template Site instructions.

Steven Speirs
SimpleViewer Support Team.

Re: Customizing A dynamic instance of simpleviewer

Is it theoretically possible to host the svcore folder and its contents on an external server, then house your xml and photos within the cms? Should that not work?

Here is my code (which is currently in place but not working):

<script xmlns="" src="http://www.geneva.edu/livingincolor/svcore/js/swfobject.js" type="text/javascript"></script>
<script xmlns="" src="http://www.geneva.edu/livingincolor/svcore/js/simpleviewer.js" type="text/javascript"></script><script xmlns="" type="text/javascript">
var flashvars={};
flashvars.galleryURL="http://www.geneva.edu/object/photos_rock_climbing_pro.html?_templateId=505";
simpleviewer.ready(function () {
simpleviewer.load("http://www.geneva.edu/livingincolor/svcore/swf/simpleviewer.swf","sv-container", "100%", "100%", "222222", true, flashvars);
});

</script>
<div xmlns="" id="sv-container"></div>


I am trying to utilize the power of our CMS's XML Generator and feed it into the new version of simpleviewer. To have dynamic image galleries. We had it working in the last version. but this new set up seems to be throwing some curves.

Thanks for any insight you can provide.

Re: Customizing A dynamic instance of simpleviewer

Is it theoretically possible to host the svcore folder and its contents on an external server, then house your xml and photos within the cms?

Please see this FAQ:
When loading images from a different domain, the images don't load or I see a 'Security Sandbox Violation' error. How do I fix this?

Here is my code (which is currently in place but not working):

The code is incorrect.
If you wish to embed a SimpleViewer-Pro v2 gallery in a web page, please use the recommended embedding code found here.
If you wish to embed only the SWF file from the 'svcore' folder, then use SWFObject as you did with SimpleViewer-Pro v1.9. You cannot use the simpleviewer.load() function to embed only the SWF file. There is no Embed Code Parameter to specify the SWF file in simpleviewer.load().

Steven Speirs
SimpleViewer Support Team.

Re: Customizing A dynamic instance of simpleviewer

Steven,
I have got it working!

I uploaded a single instance of the svcore folder only to a location on the server (outside the CMS).

Now all of our xml photo galleries generated by our CMS can dynamically use that one instance.

Thank you for all your help.

http://www.geneva.edu/object/photos_pisgah_trips