Topic: Multiple image galleries using a single config/script location

Just purchased Juicebox Pro and I love it so far.  I can't seem to find a solution to the following problem in the docs or support forum though:

I have MANY (>400) image galleries on my website.  I use a single template PHP page to access details for each of these galleries, and would like to have a dynamic PHP pointer to the proper folder for corresponding image set on the server.  But I would also like to have a single installation of the js assets, and especially the config.xml so that I can modify just that single file if I want to change the behavior of Juicebox in the future, rather than going to all those folders individually.

I saw the settings for configUrl, themeUrl, and baseUrl.  It seems like I could use the baseUrl argument to point to the image folder, but it also appears to set the location for the configUrl, which I don't want.

Is there a way to set the dynamic relative URL for ONLY the images, and keep a single, constant config URL for all galleries?

Thanks!
Todd

Re: Multiple image galleries using a single config/script location

and especially the config.xml so that I can modify just that single file if I want to change the behavior of Juicebox in the future

A possible solution might be to set up a single XML file with the gallery configurations you'd like to use. Let's call it 'preset.xml'. (There would be no need to worry about any image data in this file. It would be used only for the configuration options.)
In your PHP file which generates the XML data for each gallery (pointed towards via the configUrl option), you could read the 'preset.xml' file and copy all the configuration options (the attributes to the opening <juiceboxgallery> tag).
Something along the lines of the following should work although you may need to modify it to suit your own needs.

<?php
$filename = 'preset.xml';

$values = array();

if (file_exists($filename)) {

    $dom_doc = new DOMDocument('1.0', 'UTF-8');
    $dom_doc->load($filename);

    $settings_tags = $dom_doc->getElementsByTagName('juiceboxgallery');
    $settings_tag = $settings_tags->item(0);

    if ($settings_tag->hasAttributes()) {
        foreach ($settings_tag->attributes as $attribute) {
            $name = $attribute->nodeName;
            $value = $attribute->nodeValue;
            $values[$name] = $value;
        }
    }
}

$new_dom_doc = new DOMDocument('1.0', 'UTF-8');
$new_dom_doc->formatOutput = true;

$new_settings_tag = $new_dom_doc->createElement('juiceboxgallery');

foreach ($values as $key=>$value) {
        $new_settings_tag->setAttribute($key, $value);
    }
}

// Create image data here

$new_dom_doc->appendChild($new_settings_tag);

echo $new_dom_doc->saveXML();
?>

Alternatively, if you have only one embedding code block, you could simply set your configurations in your embedding code, rather than in the XML file. Please see here for details.

Re: Multiple image galleries using a single config/script location

Since my embedded gallery is in a PHP template page, it looks like I can set my config via options in the embed code.  I will give that a try.  I hadn't started with it yet in case I needed to change something fundamental and start over.

Thanks so much for your prompt, helpful reply!