Topic: Where do I add embed code?

Hi,

I'm building my site and can't get the SimpleViewer to work locally. Below is the code I have which is in the body tags. When I view in the browser, it just comes up with an error message saying 'Gallery XML not found.' But the gallery XML file is there. Why is it coming up with this message? If anyone could shed some light on this, that would be great.

Thanks.

Rich

<!--START SIMPLEVIEWER EMBED -->
    <script type="text/javascript" src="../simpleviewer/svcore/js/simpleviewer.js"></script>
    <script type="text/javascript">
        simpleviewer.ready(function () {
            simpleviewer.load('sv-container', '100%', '100%', 'transparent', false);
        });
    </script>
    <div id="sv-container"></div>
<!--END SIMPLEVIEWER EMBED -->

Last edited by futureproof (2011-07-06 19:34:14)

Re: Where do I add embed code?

By default, SimpleViewer will expect the XML file to be called 'gallery.xml' and for it to be located in the same directory as the HTML file into which SimpleViewer is embedded.
If this is not the case, then you can specify a name and location using the galleryURL option: http://simpleviewer.net/simpleviewer/pr … .html#html
If your gallery's XML file is called 'gallery.xml' and is located in your 'simpleviewer' folder, then your embedding code would look like this:

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

However, the links to the images within the XML file (if relative rather than absolute) will be relative to the HTML document rather than the XML file itself so you may experience a 'No Images Specified in Gallery XML.' message using the above code (depending on the location of the images and the type of URLs used).
If your entire gallery (rather than just the XML file) is located in your 'simpleviewer' folder, then use a baseURL instead of a galleryURL:

<!--START SIMPLEVIEWER EMBED -->
    <script type="text/javascript" src="../simpleviewer/svcore/js/simpleviewer.js"></script>
    <script type="text/javascript">
        var flashvars={};
        flashvars.baseURL="../simpleviewer/";
        simpleviewer.ready(function () {
            simpleviewer.load('sv-container', '100%', '100%', 'transparent', false, flashvars);
        });
    </script>
    <div id="sv-container"></div>
<!--END SIMPLEVIEWER EMBED -->
Steven Speirs
SimpleViewer Support Team.

Re: Where do I add embed code?

Hi Steven,

Great bit of help there, it worked a treat.

The functionality of the gallery now displays. Though, the images themselves are not being found by the look of it. As the thumbs are blank and there is no image visable, just the drop-shadow for the thumbs. So, what should I do now do pull in the images?

images are in - simpleviewer/images/
thumbs are in - simpleviewer/thumbs/

Cheers.

Rich

Re: Where do I add embed code?

Please post a URL to your gallery so that we can take a look.
In the meantime, try a baseURL that does not go back a level (ie. try moving your 'simpleviewer' folder into the same directory as the HTML page into which the gallery is embedded and adjust the baseURL and the path to the 'simpleviewer.js' file ion the embedding code accordingly).
Also, this FAQ may help: http://simpleviewer.net/simpleviewer/su … #trouble_2

Steven Speirs
SimpleViewer Support Team.

Re: Where do I add embed code?

I'm currently trying to make it live so I can show you guys but my host hasn't upgraded to .Net 4 yet - the site is build in ASP.NET.

Sorry about this.

So, yeah this works fine. I have put the 'images' and 'thumbs' folders in the page folder.

Thanks Steve.

Last edited by futureproof (2011-07-07 18:34:36)