Topic: index.html in different folder [SOLVED]

Is it possible to have the index.html file in a folder other than Gallery? I'm attempting to do this and I keep getting a 'Gallery xml file not found' message.

Re: index.html in different folder [SOLVED]

The 'index.html' file is a web page containing the gallery's embedding code and nothing else (to display the gallery on a page of its own).
This 'index.html' file (or any other file you choose to embed a gallery into) can be anywhere on your web server. It does not need to be inside the gallery folder.

By default (if you do not specify a galleryURL or a baseURL in your gallery's embedding code), SimpleViewer will look for a file named 'gallery.xml' in the same directory as the web page containing the embedding code.
If you take the 'index.html' file outside the gallery folder, then the 'index.html' and 'gallery.xml' files will no longer be in the same directory.
However, you can point towards a gallery folder from within your gallery's embedding code using a baseURL flashvar.
For example:

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

When using a baseURL, the the imageURL and thumbURL paths within the 'gallery.xml' file will be relative to the baseURL itself so there is no need to alter any paths within the 'gallery.xml' file.

For reference, a short descriptions of the baseURL flashvar options can be found here.

Also, the baseURL method of embedding is documented here.

I hope this points you in the right direction.
If you get stuck with anything, please let me know and, if possible, post a link to your gallery's web page so that I can see the problem for myself and hopefully help further. Thank you.

Steven Speirs
SimpleViewer Support Team

Re: index.html in different folder [SOLVED]

Perfect! Thank you.

Re: index.html in different folder [SOLVED]

Afraid I spoke too soon. I have the following code:

But I'm still getting 'Gallery xml Not Found' error.

Error in Chrome DevTools:
Failed to load resource: the server responded with a status of 404 (Not Found)

Chrome link address:
/ test / site / gallery.xml

The file is actually in:
/ test / site / images / Gallery / gallery.xml

I have no idea what I'm doing wrong???

Re: index.html in different folder [SOLVED]

The file is actually in:
/ test / site / images / Gallery / gallery.xml

If your "Gallery" directory is a complete SimpleViewer gallery folder (and your "test" directory is in your root directory as your path suggests), then you should be able to use the following embedding code.

<!--START SIMPLEVIEWER EMBED.-->
<script type="text/javascript" src="/test/site/images/Gallery/svcore/js/simpleviewer.js"></script>
<script type="text/javascript">
    var flashvars = {};
    flashvars.baseURL = "/test/site/images/Gallery/";
    simpleviewer.ready(function () {
        simpleviewer.load("sv-container", "100%", "100%", "222222", true, flashvars);
    });
</script>
<div id="sv-container"></div>
<!-- END SIMPLEVIEWER EMBED -->

The leading slashes in the paths above denote your root directory so the embedding code above should work in any web page throughout your site without modification (assuming the notes I made above are correct).

If you continue to experience difficulties, please post the URLs to the following:
(1) The web page that you are trying to embed your gallery into.
(2) Your gallery's 'gallery.xml' file.

Once I'm able to see the problem live on your web server, I should hopefully be able to determine where things are and what paths you should use.

Steven Speirs
SimpleViewer Support Team

Re: index.html in different folder [SOLVED]

Web page:
www.rkamarowski.com/test/rkamarowski/galleries.php

gallery.xml location:
www.rkamarowski.com/test/rkamarowski/images/Gallery/

Re: index.html in different folder [SOLVED]

Thanks for the links.
Knowing where your gallery folder is on your web server (and knowing that "Gallery" is a complete SimpleViewer gallery folder), you can use the following embedding code (in any web page throughout your site).

<!--START SIMPLEVIEWER EMBED.-->
<script type="text/javascript" src="/test/rkamarowski/images/Gallery/svcore/js/simpleviewer.js"></script>
<script type="text/javascript">
    var flashvars = {};
    flashvars.baseURL = "/test/rkamarowski/images/Gallery/";
    simpleviewer.ready(function () {
        simpleviewer.load("sv-container", "800", "800", "FFFFFF", true, flashvars);
    });
</script>
<div id="sv-container"></div>
<!-- END SIMPLEVIEWER EMBED -->

Incidentally, your embedding code currently uses the line:

simpleviewer.load("sv-container", "800", "800", "FFFFFF", true);

You need to include the flashvars Embed Code Parameter in the simpleviewer.load line as follows:

simpleviewer.load("sv-container", "800", "800", "FFFFFF", true, flashvars);

Otherwise, any flashvars variables that you set (such as your baseURL) will not be used.

Steven Speirs
SimpleViewer Support Team

Re: index.html in different folder [SOLVED]

The flashvars variable was the problem. Thank you very much for the help.

Re: index.html in different folder [SOLVED]

You're welcome!
I'm glad you've been able to sort things out.
Thank you for letting me know.

Steven Speirs
SimpleViewer Support Team