Topic: Embedd Juicebox and were do I set the images

Hello to all,

I am looking for a image gallery to embed and substitute the one that we use here:

https://www.hoteleus.com/circuito-533-t … ochis.html

Juicebox is beautiful but I do not understand how it loads images. We need to dinamically get the images for the gallery; is this possible with Juicebox?

Juicebox is a responsive gallery? When i change my window browser size the gallery does not change size. I am planning on putting the gallery in a column of bootrap.

Greetings,
Eddie

Re: Embedd Juicebox and were do I set the images

Juicebox is beautiful but I do not understand how it loads images.

Ordinarily, a Juicebox gallery contains a 'config.xml' file which lists the images to display. Each image has its own <image> tag in the XML file and imageURL and thumbURL attributes point towards the images and thumbnails respectively.
When you create a gallery with JuiceboxBuilder, you would add images to a gallery (on JuiceboxBuilder's 'Images' tab). The images and thumbnails are included in the gallery folder and JuiceboxBuilder generates the correct paths for the imageURL and thumbURL attributes.

You can download Juicebox-Lite from the Download Page.
Extract the 'juicebox_lite_1.5.0.zip' file and take a look at 'config.xml' file for the sample 'web' gallery ('juicebox_lite_1.5.0/web/config.xml') in a plain text editor to see what a gallery's XML configuration file looks like.

We need to dinamically get the images for the gallery; is this possible with Juicebox?

Yes. This is certainly possible. Please see this FAQ:
Can Juicebox handle a custom data source, for example RSS or Instagram?

I do not know where your images are stored but you may need to write a script (using a server-side scripting language such as PHP) to fetch the paths to your images and dynamically build a gallery's 'config.xml' file.

Please see this forum post for an example which uses a PHP script to display all images from a designated folder (scroll down to the answer to Query #3).

Dynamically generating a 'config.xml' file will work for both Juicebox-Lite and Juicebox-Pro so you can try things out with Juicebox-Lite before purchasing Juicebox-Pro.

I hope this points you in the right direction.

Juicebox is a responsive gallery?

Yes. Please see this forum post which details how to ensure that your Juicebox gallery is responsive.
Also, check out this demo full page responsive Juicebox gallery.

Re: Embedd Juicebox and were do I set the images

Hello and thanks Steven,

I do not like the way Juicebox loads images with an XML file. What is the advantage? Why did you decide to do it like that?

We have like 500 tours, each tour has its own gallery and its own url. This means that I have to create an XML file for each tour? Can the xml files have a different names?

Greetings,
Eddie

Re: Embedd Juicebox and were do I set the images

I do not like the way Juicebox loads images with an XML file. What is the advantage? Why did you decide to do it like that?

This was a design choice made by the developers. I cannot tell you why this choice was made (I have no greater insight into the original design of Juicebox than yourself) but image data needs to be stored somewhere and keeping it in an external file means that gallery images can easily be changed without the need to modify the gallery's embedding page. If image data were stored in the gallery's embedding page, then it would likely require more work to update a gallery.

We have like 500 tours, each tour has its own gallery and its own url. This means that I have to create an XML file for each tour?

Each gallery needs to have its own external configuration file (usually a 'config.xml' file).

Can the xml files have a different names?

Yes. You can use whatever filenames you like for the configuration files (and have them located wherever you like on your web server). You can point towards a specific configuration file using the configUrl option in your gallery's embedding code. A short description of configUrl can be found in the Embed Options section of the Config Options page.
For example:

<!--START JUICEBOX EMBED-->
<script src="jbcore/juicebox.js"></script>
<script>
    new juicebox({
        containerId: "juicebox-container",
        configUrl: "xml_files/custom_0001.xml",
        galleryWidth: "100%",
        galleryHeight: "100%",
        backgroundColor: "#222222"
    });
</script>
<div id="juicebox-container"></div>
<!--END JUICEBOX EMBED-->

If you are building the configuration file dynamically, then you could perhaps use just a single PHP file as a template to generate the gallery's configuration file and point towards different data sources via information in a query string.
For example:

configUrl: "config.php?image_set=1234",

Incidentally, since v1.5.0, Juicebox supports configuration data in JSON format as well as XML format (as noted in the Version History and in this blog entry).
A sample JSON configuration file (showing the required format) can be found in this forum post.
You would then use a configUrl such as:

configUrl: "config.json",

... or use a PHP script to generate JSON output.