Mambo Templates

Posted by Justin on July 14, 2005
The "I figured it out" Dept.

Recently, after setting up a custom Mambo template for a website I run, I ran into an error while installing.

The Error
The template worked perfectly fine when testing it with my local copy of MSAS 4.5.2, but my domain just didn’t like it. After creating the zip file, uploading and all that junk, I got:

XML setup file is not for a “template”.

A little odd considering the template worked fine on the net. After a little research, I found that the XML file can act “goofy” occasionally and may require a hack to fix. The hack was to setup the XML file to start as < ?xml instead of <?xml (no space between the < and ?) - didn’t work for me… After doing this, the error turned into:

Upload template - Upload Failed
ERROR: Could not find a Mambo XML setup file in the package.
Continue …
Upload template - Failed
Installation file not found:
/home/whichway/public_html/media/install_42d410d041ec4/
Continue …

Not very helpful now is it? As a side note, this breaks the process later if you leave the space…

The code - always stick to the code. Actually, they’re more like guidelines….
After some soul searching, I had one of those brilliant ideas of comparing the XML files to currently installed templates.

Pre-installed template:

<?xml version="1.0" encoding="iso-8859-1"?>
<mosinstall type="template" version="4.5.1">
<name>ms_feb2005
<creationdate>February 2005

My template:

<?xml version="1.0" encoding="iso-8859-1"?>
<mosinstall type="custom">
<name>custom
<creationdate>July 2005

See it? If not, look at the mosinstall type line. I was “smart” enough to change this to “custom” - my template name instead of leaving it alone.

Why did this happen?
Other than “because you renamed something”, it was due to the way Mambo decides what type of install you’re setting up. Basically, it thinks that I’m attempting to install a some type of module named “custom” instead of a template…