Topic: Config XML error _ have tried various solutions here

OK... have read thru a number of posts and tried a number of things. What I don't get is why the code that the desktop gallery creates doesn't seem to work and we have to find the code elsewhere here... ?

Anyway... Here's my current "path"... and the (3) sets of code I've tried, based on things I've read here.

  • Current html page I'm pasting the code into:  http://xtreme-remodeling.com/dream-decks.htm
    (it is not avail via navigation yet)
    Folder name is:  dream-deck-gallery
    Inside that folder are all the files that Juice Box generated...
    I dragged the entire folder into the main public html folder.

Then, I tried these (3) variations of the code.

THIS IS THE ORIGINAL CODE... GOT NO RESULT AT ALL:

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

THIS IS THE NEXT CODE I TRIED, BASED ON THINGS READ HERE...
AND GOT SOMETHING, BUT WITH THE XML ERROR:

<!--START JUICEBOX EMBED-->
<script src="http://www.xtreme-remodeling.com/dream-deck-gallery/jbcore/juicebox.js"></script>
<script>
new juicebox({
containerId : "juicebox-container",
baseUrl : 'http://www.xtreme-remodeling.com/dream-deck-gallery/',
galleryWidth: "100%",
galleryHeight: "100%",
backgroundColor: "#222222"
});
</script>
<div id="juicebox-container"></div>
<!--END JUICEBOX EMBED-->

FINALLY... I READ ANOTHER POST TALKING ABOUT THE config / XML FILE BEING RENAMED... And discovered, MY CODE HAD NEVER EVEN "CALLED" THAT FILE... SO I ADDED THE configURL to this code, PLUS renamed my file to mygallery.xml... Not clear if it should have been named the actual gallery name? - so I also tried it with the actual gallery name included in the code and the name of the xml.  SAME RESULT.  :( 

<!--START JUICEBOX EMBED-->
<script src="http://www.xtreme-remodeling.com/dream-deck-gallery/jbcore/juicebox.js"></script>
<script>
new juicebox({
configUrl: "mygallery.xml",
containerId : "juicebox-container",
baseUrl : 'http://www.xtreme-remodeling.com/dream-deck-gallery/',
galleryWidth: "100%",
galleryHeight: "100%",
backgroundColor: "#222222"
});
</script>
<div id="juicebox-container"></div>
<!--END JUICEBOX EMBED-->

Not sure what to try next.  This site is an older html site.
thanks!

Christine

Re: Config XML error _ have tried various solutions here

What I don't get is why the code that the desktop gallery creates doesn't seem to work and we have to find the code elsewhere here... ?

The embedding code provided on the 'Publish' tab of JuiceboxBuilder-Lite works fine when following the embedding instructions here.

www.xtreme-remodeling.com is a subdomain of xtreme-remodeling.com and all your gallery files must be on the same domain or subdomain due to the JavaScript same origin policy. Please see this web page for further details.

Your gallery currently uses the following code:

<script src="http://www.xtreme-remodeling.com/dream-deck-gallery/jbcore/juicebox.js"></script>

... so the gallery will display only when you access it using http://www.xtreme-remodeling.com/dream-decks.htm (and not http://xtreme-remodeling.com/dream-decks.htm).

Use relative paths within your embedding code and your gallery should display at both www.xtreme-remodeling.com and xtreme-remodeling.com

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

FINALLY... I READ ANOTHER POST TALKING ABOUT THE config / XML FILE BEING RENAMED... And discovered, MY CODE HAD NEVER EVEN "CALLED" THAT FILE... SO I ADDED THE configURL to this code, PLUS renamed my file to mygallery.xml... Not clear if it should have been named the actual gallery name? - so I also tried it with the actual gallery name included in the code and the name of the xml.  SAME RESULT.  :(

If your gallery's XML file is named 'config.xml' (which it is by default when creating a gallery with JuiceboxBuilder-Lite) and is located in the same directory as the HTML page continaing the embedding code, then there is no need to use the configUrl configuration option. (You will need to specify a configUrl only if you rename or move your gallery's XML file.

Re: Config XML error _ have tried various solutions here

THANK YOU SO MUCH!  It worked, and I'm one happy camper!
I didn't notice or quite understand the path... but I'm not a developer, and totally missed it.

One other thing I did and wondering if it's necessary (or not)... since this site is old...is that I changed the top DOC from this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

to this:

<!DOCTYPE html>  <html lang="en"> 

I have 3 more gallery pages to do, so wondering if I should do it to those also...(not sure if it makes a diff. or not)... ?

THANKS AGAIN...  for some reason didn't get email notification of your reply, so glad that I came looking.  :)

4 (edited by ctabor1 2013-02-18 20:55:54)

Re: Config XML error _ have tried various solutions here

EDIT:
OK... FIGURED IT OUT... RENAMED THE XML TO THE NAME OF THE GALLERY... WORKING NOW





When I replaced my code to follow your recommendations above, it worked fine (for the decks example)...

So, I went ahead and created a html page for the "bath-gallery" as I did for decks before... this time named "xtreme-baths.htm"...

... and the gallery folder I created and uploaded is named "bath-gallery". 

Here is the code...

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

...but I'm getting the xml error again. Confused, as I believe it mimics the decks gallery.

FYI, inside of the folder the default xml is titled "config.xml"  (for both bath and decks)...  yet your code inserts the gallery name... which is what I did for baths...  and don't understand why the new gallery is not displaying...  :(

Am I missing something?

Re: Config XML error _ have tried various solutions here

One other thing I did and wondering if it's necessary (or not)... since this site is old...is that I changed the top DOC from this:

It does not matter what Doctype Declaration your web page uses as long as your page uses one and that the code on the page conforms to the set of standards that you choose to use.
You can check that the code on your page validates correctly with the W3C Markup Validation Service.
If any errors are reported, they should be fixed. A page containing valid code should be rendered with greater predictability and consistency across different browsers.

...but I'm getting the xml error again.

If using a baseUrl, Juicebox will, by default, look for the XML file to be named 'config.xml' and to be located in the baseUrl folder.
In your code, you have specified:

configUrl: "bath-gallery.xml",

This is a relative path (relative to the baseUrl folder) and so your gallery's XML file should be named 'bath-gallery.xml' and located in the baseUrl folder.
Just remove the configUrl line from your gallery's embedding code (or rename your gallery's XML file from 'config.xml' to 'bath-gallery.xml') and your gallery should display.

6 (edited by aopchuck 2013-03-24 23:33:21)

Re: Config XML error _ have tried various solutions here

Thanks for a great program.  I converted the config file to a php file, so I could easily pass variables to it.  I stumbled a couple of times, but thought I'd post my code here, so an arm chair coder like myself may be spared a few minutes.  I'm sure there's probably an easier way to do this, but I'm self-taught, and this is what I came up with. 

To convert the config file to php, replace the existing header line with the following, and change the extension to php:

<?
header("Content-Type: application/xhtml xml; charset=UTF-8");
?>

To pass a variable to the php file I found I needed to use the full URL.  A relative path doesn't work on my server, or perhaps any server.  But you may run into a problem (as I did) with the error "Juicebox Error: Config XML file not found" if your site is accessed both from www.mysite.com and just mysite.com.  I wrote the following little workaround for that, so the full URL path would be compatible regardless of how the site is accessed:

This code detects if your guest is using "www" or not.

<?
$isWWW = substr($_SERVER['SERVER_NAME'], 0, 3); //Is visitor coming in on "www?"  
if ($isWWW == www)  
    {
        $preURL = "www.";
    }
    else
    {
    $preURL = "";    
    }
?>

Then to create the actual link, just modify your Juicebox settings like this:

configUrl: "http://<?=$preURL?>mysite.com/path/to/config.php?var1=<?=$var1?>&var2=<?=$var2?>"

This worked for me, but I'd love to see a real coder's hand on this.

Re: Config XML error _ have tried various solutions here

I'll join this topic hoping because it's still the same problem.

And I'll start the same way: "I tried everything..!" (I think). Followed this topic and found mistakes in my code, fixed them. Checked the code in http://validator.w3.org/ as well and the only errors that it shows are in the code that's generated by JuiceboxBuilder-Lite - it expects "type" for <script>.
Anyway, I have two galleries under two separate folders so I used baseUrl. Then I tried renaming the gallery files from config.xml files and use configUrl.

Still the same result : Juicebox Error: Config XML file not found happens sometimes (even though it's not Config.XML any more). BUT it does load it if I refresh. Sometimes one refresh is enough, sometimes needs more.

First gallery: http://www.irmucha.pl/nieswiateczne.html , second one: http://www.irmucha.pl/swiateczne.html

Re: Config XML error _ have tried various solutions here

@Michal

Checked the code in http://validator.w3.org/ as well and the only errors that it shows are in the code that's generated by JuiceboxBuilder-Lite - it expects "type" for <script>.

This is only because your page uses the XHTML 1.0 Transitional Doctype Declaration.
If your page uses the HTML5 Doctype Declaration (like the sample 'index.html' page in the 'web' folder), then you would not get this error message.

Still the same result : Juicebox Error: Config XML file not found happens sometimes (even though it's not Config.XML any more).

The error message refers to a generic 'configuration XML file' rather than a specific file named 'config.xml'.

BUT it does load it if I refresh. Sometimes one refresh is enough, sometimes needs more.

Your page loads the 'juicebox.js' file twice (from two different locations):

<script type="text/javascript" src="./nieswiateczne/jbcore/juicebox.js"></script>
<script src="swiateczne/jbcore/juicebox.js"></script>

Try removing one of them to see if this makes a difference.
Also, it should not make a difference but try renaming your XML files to the default 'config.xml' and then remove the configUrl option from your embedding code.

Re: Config XML error _ have tried various solutions here

This is only because your page uses the XHTML 1.0 Transitional Doctype Declaration.
If your page uses the HTML5 Doctype Declaration (like the sample 'index.html' page in the 'web' folder), then you would not get this error message.

Changed to HTML5

Your page loads the 'juicebox.js' file twice (from two different locations):

<script type="text/javascript" src="./nieswiateczne/jbcore/juicebox.js"></script>
<script src="swiateczne/jbcore/juicebox.js"></script>

Try removing one of them to see if this makes a difference.

Done. I could only remove the second one from the body part. If the one from the head section is removed then auto-scaling function to fit the picture between header and footer stops working.

Also, it should not make a difference but try renaming your XML files to the default 'config.xml' and then remove the configUrl option from your embedding code.

Done that too but as you said, it did not make a difference.

So unfortunately I still sometimes get the error.

Re: Config XML error _ have tried various solutions here

On this web page: http://www.irmucha.pl/nieswiateczne.html
... it looks like the initial gallery is being displayed by the following code:

$(document).ready(function () {
    doLayout();
    $(window).bind('resize', doLayout);
    new juicebox({
        containerid : 'juicebox-container'
    });
});

... and this instance of Juicebox does not have a valid 'config.xml' file in the correct location.
Try adding the baseURL configuration option (from the embedding code further down your page) to the code above, i.e.:

$(document).ready(function () {
    doLayout();
    $(window).bind('resize', doLayout);
    new juicebox({
        containerid : 'juicebox-container',
        baseUrl : 'nieswiateczne/'
    });
});

I expect that you may not need both instances of embedding code on your page.
Once you have added the baseURL configuration option to the first instance (at the top of the page), try removing the second instance (at the bottom of the page).

Re: Config XML error _ have tried various solutions here

Yes, this is it. I didn't realize that the common embedding code should not be used at all when using the "Resizable Gallery with a Header" source code. It already has embedding code.

Small suggestion: if just the support for "Using a Resizable Gallery with a Header" was a bit more specific about what to do then maybe I wouldn't make this mistake. It shows the example but I couldn't find any information how to use it. Found somewhere in the forum that I should get the source code.

Anyway many thanks for great galleries and great support.