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.