Topic: Two Embed Codes from Separate Galleries on Same Page: One Gallery

A while ago, I used SV Pro to put a gallery on a media page on my website with images from a conference.

I have now tried to place a second gallery on the same page, higher up (along with lots of other non-related content in between this and the earlier posting.) 

In uploading the page via Dreamweaver, it removes the earlier gallery lower down on the page but places it in the spot, where I have tried to include the more recent content.

In other words, I have one gallery not two. The gallery I have is the earlier one in the wrong position on the page. The more recent, required one is nowhere to be seen.

I am using Flickr and in the 'customise' screen clearly see the relevant photos from this year. The embed code eventually generated of course is very generalised, not differentiating between the two galleries or including all the Flickr Set ID etc that I was asked for originally.

I may have missed a step, forgotten from last time I did this. Or I may need a more bespoke embed code that is beyond my pay grade..

Hope that this is all clear. Help appreciated, please! Thanks.

Last edited by BGD (2014-10-21 09:45:22)

Re: Two Embed Codes from Separate Galleries on Same Page: One Gallery

When embedding multiple galleries in a single web page, please do the following:
(1) Make sure that you load the 'simpleviewer.js' file only once per page (not once per gallery).
(2) Make sure that you load each gallery into a container with a unique name (a <div> with a unique 'id').
(3) If you use flashvars for options such as galleryURL or baseURL, then make sure that each flashvar variable has a unique name for each gallery.

For example, to load two different galleries into a single web page (in this example, two gallery folders named 'gallery1' and 'gallery2' located in the root directory), the embedding code might look something like this:

<script type="text/javascript" src="/gallery1/svcore/js/simpleviewer.js"></script>

<script type="text/javascript">
    var flashvars1 = {};
    flashvars1.baseURL = "/gallery1/";
    simpleviewer.ready(function () {
        simpleviewer.load("sv-container1", "100%", "100%", "222222", true, flashvars1);
});
</script>
<div id="sv-container1"></div>

<script type="text/javascript">
    var flashvars2 = {};
    flashvars2.baseURL = "/gallery2/";
    simpleviewer.ready(function () {
        simpleviewer.load("sv-container2", "100%", "100%", "222222", true, flashvars2);
});
</script>
<div id="sv-container2"></div>

We also have further instructions and online examples of Embedding Multiple Galleries here.

I hope this helps.

Steven Speirs
SimpleViewer Support Team.

Re: Two Embed Codes from Separate Galleries on Same Page: One Gallery

Hi Steven, could not follow that too exactly..Would post the trial page for a recommendation, but not keen for Google to pick it up. Is there any alternative apart from battling on?

I believe that the baseURL option is for when I am uploading the physical items to my website? In this case, I am trying to link to Flickr, where both sets of images are.

Last edited by BGD (2014-10-21 18:36:05)

Re: Two Embed Codes from Separate Galleries on Same Page: One Gallery

Please check your email. I have sent you a message with an email address where you can send me the URL to your web page so that I can take a look at it for myself and hopefully help further.

A baseURL points towards a complete gallery folder (exactly as created by svBuilder-Pro with no modifications) no matter whether the gallery is sourced by local images or a Flickr account.

Steven Speirs
SimpleViewer Support Team.