Topic: Multiple Galleries on one html page - syntax problem maybe?

Hey there-
Was looking for a gallery application to use for creating multiple galleries on one page of a website I'm doing for a client. Simpleviewer seems to be a great tool, but once I start to adjust the js, it starts buggin out on me. I read through dozens of posting/threads last night and can't seem to find one having the same issue as mine - so I'm posting!

The first gallery I embed works great in all browsers. Once I load the second gallery(which works perfect by itself), I KNOW that I have to adjust the js to call the galleries independently or else it won't work. I make sure I am using ABSOLUTE baseURLs to path everything correctly and separately - but after I am done adjusting both galleries, the second gallery is showing in both gallery spots. After HOURS of testing and adjusting, I went ahead and made a stand alone page to test both galleries in.

http://www.rjvandcompanylc.com/image_test.html

and here is the very simple source code (everything within the <body>):
-------------------------------------------------

<body style="height:900px; width:1000px; border: 1px red solid;">

<!--START SIMPLEVIEWER EMBED.-->
<script type="text/javascript" src="http://www.rjvandcompanylc.com/gallery1/svcore/js/simpleviewer.js"></script>
<script type="text/javascript">
var flashvars = {};
flashvars.baseURL = "http://www.rjvandcompanylc.com/gallery1/";
jQuery(document).ready(function () {
SV.simpleviewer.load("sv-container1", "325px", "400px", "FFFFFF", true, flashvars);
});
</script>
<div id="sv-container1" style="border:1px purple solid; width:350px; height:400px;"></div>
<!-- END SIMPLEVIEWER EMBED -->

<!--START SIMPLEVIEWER EMBED.-->
<script type="text/javascript" src="http://www.rjvandcompanylc.com/gallery2/svcore/js/simpleviewer.js"></script>
<script type="text/javascript">
var flashvars = {};
flashvars.baseURL = "http://www.rjvandcompanylc.com/gallery2/";
jQuery(document).ready(function () {
SV.simpleviewer.load("sv-container2", "325px", "400px", "FFFFFF", true, flashvars);
});
</script>
<div id="sv-container2" style="border:1px green solid; width:350px; height:400px;"></div>
<!-- END SIMPLEVIEWER EMBED -->

</body>
-------------------------------------
The top and bottom gallery should be different. I can see that the bottom gallery is overriding the top gallery and have NO IDEA WHY.  I'm sure it's some js thing I can't figure out - but I do want to point out that I have tried so many different thing modeling the support forum - even downloading and trying to load the test files from the site - I've tried making everything galleryURLs and that didn't work either, so I'm using absolute baseURLs just to make sure everything is pathed correctly.  I'm probably doing that wrong too. Please help!

-LG 

P.S.

Re: Multiple Galleries on one html page - syntax problem maybe?

Try using two different variable names for each set of flashvars:

<body style="height:900px; width:1000px; border: 1px red solid;">

<!--START SIMPLEVIEWER EMBED.-->
<script type="text/javascript" src="http://www.rjvandcompanylc.com/gallery1/svcore/js/simpleviewer.js"></script>
<script type="text/javascript">
var flashvars1 = {};
flashvars1.baseURL = "http://www.rjvandcompanylc.com/gallery1/";
jQuery(document).ready(function () {
SV.simpleviewer.load("sv-container1", "325px", "400px", "FFFFFF", true, flashvars1);
});
</script>
<div id="sv-container1" style="border:1px purple solid; width:350px; height:400px;"></div>
<!-- END SIMPLEVIEWER EMBED -->

<!--START SIMPLEVIEWER EMBED.-->
<script type="text/javascript" src="http://www.rjvandcompanylc.com/gallery2/svcore/js/simpleviewer.js"></script>
<script type="text/javascript">
var flashvars2 = {};
flashvars2.baseURL = "http://www.rjvandcompanylc.com/gallery2/";
jQuery(document).ready(function () {
SV.simpleviewer.load("sv-container2", "325px", "400px", "FFFFFF", true, flashvars2);
});
</script>
<div id="sv-container2" style="border:1px green solid; width:350px; height:400px;"></div>
<!-- END SIMPLEVIEWER EMBED -->

</body>
Steven Speirs
SimpleViewer Support Team.

Re: Multiple Galleries on one html page - syntax problem maybe?

You rock dude. Thank you thank you THANK YOU. That did the trick! PEACE!

Re: Multiple Galleries on one html page - syntax problem maybe?

I am unable to produce two galleries on one HTML page.  I have one gallery that works perfectly on the site.  When I am producing the second one I get to the "Save" option it asks "The selected folder contains files that may be overwritten. Do you want to overwrite the selected folder?"  If I do, then the previous gallery is overwritten because the three directories have the same names - "images" "svcore" and "thumbs"

How can I create a second gallery on the same HTML page?

Ron

Re: Multiple Galleries on one html page - syntax problem maybe?

You should save each gallery into a separate (differently-named) folder.
The instructions for embedding Multiplte Galleries can be found here: http://simpleviewer.net/simpleviewer/su … l#multiple

Steven Speirs
SimpleViewer Support Team.

Re: Multiple Galleries on one html page - syntax problem maybe?

OK - I'm halfway there. I followed the instructions in the multiply galleries example and both galleries show and work perfectly in my HTML editor.  But when I post the page to my server, the second gallery does not show up.

Here is the web page I'm am posting the galleries to: http://www.daytrippingmetro.com/civilwa … m#antietam

I must be doing something wrong.

Here is the code for the two galleries:


<!--START SIMPLEVIEWER EMBED.-->
<script type="text/javascript" src="svcore/js/simpleviewer.js"></script>
<script type="text/javascript">
jQuery(document).ready(function () {
SV.simpleviewer.load("sv-container1", "70%", "100%", "222222", true );
});
</script>
<div id="sv-container1"></div>
<!-- END SIMPLEVIEWER EMBED -->


<!--START SIMPLEVIEWER EMBED.-->       
        <script type="text/javascript">
        $(document).ready(function () {
            SV.simpleviewer.load('sv-container2', '70%', '100%', '222222',true,{baseURL: 'c:/webpages/daytripping/AntietamBattleField'});
        });
        </script>

        <div id="sv-container2"></div>
        <!-- END SIMPLEVIEWER EMBED -->

Re: Multiple Galleries on one html page - syntax problem maybe?

Nevermind.  I figured it out.

The base URL in the second one was pointing to the wrong address.

Re: Multiple Galleries on one html page - syntax problem maybe?

I'm in the same boat and I have basically copied the code above.  My condition is that I have a main fbp folder and my main index.html is inside along with my gallery folders.  So I thought that this code would call up the galleries from those folders and play the flash slides.

Confused about the div id= sv-container1 and 2, do I need to write a certain code in the style sheet?

In the example on the SV site, they had named their gallery folders gallery1 and gallery2.  I did the exact same but I didn't change anything inside the gallery folders. 

Do I leave the pre-made index.html inside each gallery folder?
Do I need to modify any other files inside the folders that SV creates?

Any help on this would be amazing!

Below is my code for the page and here is the link for the page:  http://www.todddouglasphoto.com/fbp/index2.html


<html>
<head>
<link href="style1.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
<!--
body,td,th {
    font-family: Arial, Helvetica, sans-serif;
    color: #FFFFFF;
}

-->
</style><body leftmargin="0" topmargin="0">
<img src="images/header.jpg" width="520" height="140">
<img src="images/spacer.jpg" width="520" height="30">

<h2>Wedding Portfolio</h2>
<!--START SIMPLEVIEWER EMBED.-->
<script type="text/javascript" src="http://www.todddouglasphoto.com/fbp/gallery1/svcore/js/simpleviewer.js"></script>
<script type="text/javascript">
var flashvars1 = {};
flashvars1.baseURL = "http://www.todddouglasphoto.com/fbp/gallery1/";
jQuery(document).ready(function () {
SV.simpleviewer.load("sv-container1", "100%", "100%", true, flashvars1);
});
</script>
<div id="sv-container1" style="border:1px white solid; width:520px; height:390px;"></div>
<!-- END SIMPLEVIEWER EMBED -->
<img src="images/spacer.jpg" width="520" height="30">
<h2>Engagement Portfolio</h2>
<!--START SIMPLEVIEWER EMBED.-->
<script type="text/javascript" src="http://www.todddouglasphoto.com/fbp/gallery2/svcore/js/simpleviewer.js"></script>
<script type="text/javascript">
var flashvars2 = {};
flashvars2.baseURL = "http://www.todddouglasphoto.com/fbp/gallery2/";
jQuery(document).ready(function () {
SV.simpleviewer.load("sv-container2", "100%", "100%", true, flashvars2);
});
</script>
<div id="sv-container2" style="border:1px white solid; width:520px; height:390px;"></div>
<!-- END SIMPLEVIEWER EMBED -->
</body>
</html>



Thanks a million!

Re: Multiple Galleries on one html page - syntax problem maybe?

Do I leave the pre-made index.html inside each gallery folder?

You can do. They will not be used if you embed the galleries into another HTML page but it will do no harm leaving them there.

Do I need to modify any other files inside the folders that SV creates?

No. The gallery folders created by svBuilder can be left unmodified.

The first thing I notice is that the location for the 'simpleviewer.js' file in the first gallery is incorrect.
Going directly to http://www.todddouglasphoto.com/fbp/gal … eviewer.js in a browser results in an error 404 (file not found).

I also notice that your HTML document does not use a Doctype Declaration and has several errors which should be fixed (for example, there is no closing </head> tag on the page).
A suitable Doctype Declaration should be used. See here for details: http://www.w3.org/QA/2002/04/valid-dtd-list.html
Your HTML document can be checked for errors using the W3C Markup Validation Service.

Also, you are using SimpleViewer v2.1.2.
You could try upgrading to the latest version (v2.1.3).
Upgrades are free within the same major version number and several bugs have been fixed in v2.1.3.
See here for details: http://simpleviewer.net/simpleviewer/pr … grade.html

Steven Speirs
SimpleViewer Support Team.

Re: Multiple Galleries on one html page - syntax problem maybe?

Thanks for the in-depth reply!  I have fixed all the items that you mentioned in your note.  Unfortunately, that didn't fix the overall issue.  sad

I read on a different forum that someone put the two gallery.xml files outside the gallery folders.  Could that possibly do anything?  I haven't modified those files at all at this point.  As you mentioned, I shouldn't have to do anything with the gallery folders.

Here are the two gallery slideshows that run perfectly when I go straight to them:

http://www.todddouglasphoto.com/fbp/gallery1/index.html
http://www.todddouglasphoto.com/fbp/gallery2/index.html

Any other items that you can think of that might be causing the problem?  Not sure what else to post (code-wise) that could give a better overall picture so that you could help.

Thanks again for the help!

The page again is:  http://www.todddouglasphoto.com/fbp/index2.html

Re: Multiple Galleries on one html page - syntax problem maybe?

Your embedding code lines are missing a parameter (the backgroundColor).
See here for details: http://simpleviewer.net/simpleviewer/su … tml#params

Now that you are using SimpleViewer v2.1.3, you should also change the embedding code to the new version.
See here for details: http://simpleviewer.net/simpleviewer/su … html#embed

Essentially, change:

jQuery(document).ready(function () {
SV.simpleviewer.load("sv-container1", "100%", "100%", true, flashvars1);
});

... to:

simpleviewer.ready(function () {
simpleviewer.load("sv-container1", "100%", "100%", "222222", true, flashvars1);
});

Also, change:

jQuery(document).ready(function () {
SV.simpleviewer.load("sv-container2", "100%", "100%", true, flashvars2);
});

... to:

simpleviewer.ready(function () {
simpleviewer.load("sv-container2", "100%", "100%", "222222", true, flashvars2);
});

You can change the "222222" entries above for whatever background color you'd like to use (or use "transparent" for an HTML background to show through).

Steven Speirs
SimpleViewer Support Team.

Re: Multiple Galleries on one html page - syntax problem maybe?

smile  smile  smile  smile

YOU ARE THE MAN!!!

I can not thank you enough!  I bet you all this time (even though I needed to clean up the page), it was the background parameter!  I "assumed" that since mine was set to transparent in SV that I didn't need to type that in the code.  DUMB!  It's working perfectly now!

Here is the updated link now on my Facebook: http://www.facebook.com/todddouglasphot … 6186210675

Thanks you so, so much again!