Topic: embed with a separate external gallery folder

Can anyone tell me how to embed a Simple Viewer Gallery into a webpage by referencing an external gallery folder?

I am building my site using a CMS so all pages are dynamically generated and I have different galleries on different pages.  In the past I was able to embed successfully using this format:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>

<script type="text/javascript"> 
            var flashvars = {};
            flashvars.galleryURL = "http://domain.com/svmanager/g1/gallery.xml";
            var params = {};            
                        params.wmode="transparent";
            swfobject.embedSWF("http://domain.com/svmanager/g1/simpleviewer.swf", "flashContent", "620px", "590px", "9.0.124", false, flashvars, params);
        </script> 

<div id="flashContent"></div>  

However, with the new version it seems that the preferred embed code looks like this:

<script type="text/javascript" src="svcore/js/simpleviewer.js"></script>
<script type="text/javascript">
$(document).ready(function () {
SV.simpleviewer.load("sv-container", "100%", "100%", "222222", true);
});
</script>
<div id="sv-container"></div>
  • So, how do I modify this so that I can reference a gallery within the g1 folder ? (note, my "index" page is elsewhere)

AND

  • Where do I put the flashvars and params?

I need to be able to use the flashvars.galleryURL and params.wmode="transparent" modifiers. 

I've already referenced this page :http://www.simpleviewer.net/simpleviewer/support/embedding.html  but the links that I need seem to be broken.

I tried doing this:

<script type="text/javascript">
    var flashvars = {};
        flashvars.galleryURL = "http://predragtheartist.com/svmanager/g1/gallery.xml";
    var params = {};            
        params.wmode="transparent";

$(document).ready(function () {

    SV.simpleviewer.load("sv-container", "620px", "590px", "000000", true, flashvars, params);
});
</script>

AND

<script type="text/javascript">
    
$(document).ready(function () {
        var flashvars = {};
        flashvars.galleryURL = "http://predragtheartist.com/svmanager/g1/gallery.xml";
    var params = {};            
        params.wmode="transparent";

    SV.simpleviewer.load("sv-container", "620px", "590px", "000000", true, flashvars, params);
});
</script>

but neither of them work.  When I look in the Pro folder at the examples they still show everything embeded using the earlier swfobject code, which DOES still work, but then what's the point since that doesn't allow me to take advantage of the mobile detection / alternate player?

Re: embed with a separate external gallery folder

The following code should work:

<!--START SIMPLEVIEWER EMBED.-->
<script type="text/javascript" src="svcore/js/simpleviewer.js"></script>
<script type="text/javascript">
var flashvars = {};
flashvars.galleryURL = "http://predragtheartist.com/svmanager/g1/gallery.xml";
var params = {};            
params.wmode="transparent";
$(document).ready(function () {
SV.simpleviewer.load("sv-container", "100%", "100%", "222222", true, flashvars, params);
});
</script>
<div id="sv-container"></div>
<!-- END SIMPLEVIEWER EMBED -->

You need the complete 'svcore' folder alongside the HTML page containing the above code and any relative links within gallery.xml (eg paths to images and thumbs) will be relative to the HTML page.

Steven Speirs
SimpleViewer Support Team.

Re: embed with a separate external gallery folder

Hi,

we are still in the process of updating the docs and examples for v2.1. I've updated the embed documentation to address both of the issues you mentioned.

Felix Turner
SimpleViewer Support Team.