Topic: multiple embedded galleries, one webpage

I should first state that yes, I have tried with just 2 galleries and whilst one loads, the other is a "no show" despite the embed code being where it needs to be.


I am new to Juicebox, but not to websites nor building  or editing the pages, so am familiar enough to do what needs doing.

What I am struggling with, however, is getting the second gallery to show.  I tried changing the "container ID" by adding a numeric digit after it (in both locations) but that as failed and I have been bumping up against a wall, going around in ciurcles chasing my tail trying to figure it out and yes, I have read over the embedding guide.

I have tried using the external jbcore folder method and that also did not work, so I am left scratching my head unless somebody has an idea of how to get the galleries to show?

Why do I need this? I run a website for a long running show and have recently been given a catalogue of photographs from previous shows. Therefore, that requires separate galleries, yet they need to be on the same page. Complicated? no.  Easy? thought so, obviously not.

Re: multiple embedded galleries, one webpage

Hi.
I'm sorry to hear that you are having difficulty with Juicebox-Pro.
I hope my notes below help.

First of all, just in case you've not yet seen it, please take a look at the Embedding Multiple Galleries support section. There are several online examples (whose source you can view in your browser) which might help.

The key to embedding multiple galleries into a single web page is to keep the galleries separate from each other and, as you have already tried, embed each gallery into a container with a unique 'id'. (Make sure that the containerId in the embedding code matches the actual 'id' of the container <div>.)

The easiest way to do this would be to use the baseUrl method of embedding documented here. This allows you to keep each gallery in its own individual folder (and prevents gallery files from getting mixed up or overwritten).
The baseUrl embedding code is essentially the same as the regular embedding code but with a baseUrl entry pointing towards a gallery folder.

Also, you'll only need to load the 'juicebox.js' file once per page (not once per gallery), so just load the file from within one of your galleries.

Here's an example.

(1) Create two galleries with JuiceboxBuilder-Pro and save them to two different folders named 'gallery1' and 'gallery2'.

(2) Upload these two complete gallery folders to the root directory of your web server.

(3) Now use the following embedding code (which will display the galleries one below the other).

<script src="/gallery1/jbcore/juicebox.js"></script>

<script>
  new juicebox({
    baseUrl: "/gallery1/",
    containerId: "juicebox-container1",
    galleryWidth: "800",
    galleryHeight: "600",
    backgroundColor: "#222222"
  });
</script>
<div id="juicebox-container1"></div>

<script>
  new juicebox({
    baseUrl: "/gallery2/",
    containerId: "juicebox-container2",
    galleryWidth: "800",
    galleryHeight: "600",
    backgroundColor: "#222222"
  });
</script>
<div id="juicebox-container2"></div>

The leading slashes in the paths above denote your root directory so the code above will work (without modification) in any web page throughout your site as long as your gallery folders are named 'gallery1' and 'gallery2' and are located in your root directory.

You can, of course, name your gallery folders anything you like and upload them to any location you like, as long as the paths in the embedding code (the path to the 'juicebox.js' file and the baseUrl entries) are correct.
The baseUrl entries can be relative paths (relative to the web page containing the embedding code) or absolute paths (starting with http:// or https://).

I hope this helps.
However, if you continue to experience difficulties, please let me know and I'll try to help further.
If possible, please post a link to your web page so that I can see the problem for myself and hopefully determine exactly what the problem is and propose a solution.
Thank you.

Re: multiple embedded galleries, one webpage

Steven @ Juicebox,

Thanks, that helped a great deal.

It was the action of only calling one copy of the juicebox.js file that solved it.

It is often the things that you **think** you have sorted that someone else mentions, that then makes you go back and double check for the umpteenth!


I think the most apt phrase was mooted by homer simpson "DOH!!"

4 (edited by Hoover5Ron 2022-06-29 12:22:18)

Re: multiple embedded galleries, one webpage

Purely in the interests of clarification, perhaps over clarification(?) I have quoted and notated your post.

Steven @ Juicebox wrote:

[snip][/snip]

First of all, just in case you've not yet seen it, please take a look at the Embedding Multiple Galleries support section. There are several online examples (whose source you can view in your browser) which might help.

I did read that, yet I still missed the obvious.  Perhaps I should have mentioned that..


Steven @ Juicebox wrote:

The easiest way to do this would be to use the baseUrl method of embedding documented here. This allows you to keep each gallery in its own individual folder (and prevents gallery files from getting mixed up or overwritten).
The baseUrl embedding code is essentially the same as the regular embedding code but with a baseUrl entry pointing towards a gallery folder.

That's the method I am using... Again, perhaps I should have mentioned that...

Steven @ Juicebox wrote:

Also, you'll only need to load the 'juicebox.js' file once per page (not once per gallery), so just load the file from within one of your galleries.

That is what I did not pick up on until you mentioned it. ;)

Steven @ Juicebox wrote:

Here's an example.

(1) Create two galleries with JuiceboxBuilder-Pro and save them to two different folders named 'gallery1' and 'gallery2'.

(2) Upload these two complete gallery folders to the root directory of your web server.

Using a similar method, the difference being that the folders are placed differently. I still missed the point with the single juicebox.js file load though....

Steven @ Juicebox wrote:

You can, of course, name your gallery folders anything you like and ***upload them to any location you like, as long as the paths in the embedding code (the path to the 'juicebox.js' file and the baseUrl entries) are correct.***
[snip][/snip].

Had that figured from the beginning ;)

Steven @ Juicebox wrote:

I hope this helps.

See my previous post ;)

Re: multiple embedded galleries, one webpage

I'm glad you've got it working.
Thank you for posting back to let me know. It's most appreciated.

6 (edited by Hoover5Ron 2022-06-30 06:48:14)

Re: multiple embedded galleries, one webpage

Actually, I have pushed the methedology and managed 25 Galleries on one page one under the other, all calling only one Juciebox.js file.  I di not fancy pushing it any further as I had proven to myself the point of the excercise.

That was all on my local testing server, so at the moment, it is not "live" live, but I did put it on the actual server to test it before removing it directly the result was known.

That does not include the intermediate text (Gallery title and "back to top" link) that is placed between each gallery either.

Now, if nested galleries were a thing (all galleries listed in one "Main" gallery to save a very long page) it would be useful. I think, however, I may have missed that somewhere if it is possible........

I know I could use an image from each gallery in a "Master" gallery to "Link out" to each specific gallery, but then that starts adding pages, or iframe pages, that I would rather avoid.

Then again......     hmmmm.............   ::thinking cap on::

LOL

Re: multiple embedded galleries, one webpage

It is possible to have just a single gallery displayed on a web page and switch the gallery (using links).
Check out the 'Switching between Multiple Galleries using JavaScript' example in the Embedding Multiple Galleries support section.

I've made a single-page template using this method and have posted it here (with instructions).
You could use/modify it to suit your own needs (or, at the very least, examine the code to see how it works).

If you are looking for a fully automated way to create and list multiple galleries, then you might like to look into another of our products: Showkase.

Showkase is a PHP web application (installed on your web server rather than your computer) which allows you to create a complete portfolio web site (integrating multiple galleries) online.
Showkase has full support for Juicebox-Pro and the galleries can be created within the application itself in a web browser interface (or created with JuiceboxBuilder or the Lightroom plugin and then imported via Showkase's 'Site -> Import' functionality).

You can create Gallery Index pages and have as many galleries listed on each Gallery Index page as you wish.
Each gallery is represented by a thumbnail image with the gallery title displayed below and the gallery is opened when the user clicks on the image (just like your current website).
Demo Sites created with Showkase can be found here and a sample Gallery Index Page can be found here.

Showkase can also create non-gallery pages (About, Basic and Contact pages) where you can add information about yourself (or any other content you like).
All of this is done automatically within the Showkase interface without the need for any manual coding at all.
You can take a look around the Showkase interface by logging into the Live Demo Admin.

Showkase can be purchased as Showkase-Standard (which comes with Juicebox-Lite, the free version) or Showkase-Pro (which comes with Juicebox-Pro) from the Download Page.
The only difference between Showkase-Standard and Showkase-Pro is the bundled viewer (Juicebox-Lite vs Juicebox-Pro).
If you already have Juicebox-Pro, then you could purchase Showkase-Standard (if you wanted to) and integrate your Juicebox-Pro files by following the 'Installing Juicebox-Pro' instructions here.

I hope this information is helpful.

8 (edited by Hoover5Ron 2022-07-01 04:00:42)

Re: multiple embedded galleries, one webpage

I did say I may have missed the nested gallery trick.

The Javascript switch is something I missed, but I will look into that.

*** EDIT ***

Having looked at the javascript switch, I have indeed managed something that suffices needs for now.  May not look "professional", but it does serve the needs. I have a test page up and so far,, it is working out well under testing.

*** EDIT ***

As for showcase, I looked at that, but I am not certain it will suit the intended purpose of integration into the existing website,  using the exact style of the website, nor am I inclined to purchase one copy for each website I run (at least 6 which all need galleries), which is why I purchased the JB-Pro Unlimited license.

If an unlimited website version of showkase were offered, I **might** consider it. until then, I will stay with JB pro.

As an aside and as much as I appreciate the advice to look at it, I do not need a sales pitch for showkase, which, to me, the better part of your post is. A simple explanation and a link would have sufficed. Don't want to sound harsh an apologies if I do, but as I say, advising to look at something is different to a sales pitch.

Re: multiple embedded galleries, one webpage

I'm sorry. I was just trying to help by providing as much relevant information about multiple galleries as possible (and perhaps pre-empting some questions that you may have had about Showkase should you have considered it).
I wish you well with Juicebox.