Goal
To create an empty template from an existing one. This in order so you can modify anything you like in a template you created.
 
Note: “Duplicate page” is a powerful option, it still doesn’t allow you to change things as the Navigation bar etc.
 
 
Site2template links:
 
Disclaimer: YMMV.
Your Miles May Vary...
For me it all worked - no sweat.
 
Create an empty Template
SITE2TEMPLATE
This utility appeared om macosxhints.com some time ago. It worked nicely with iWeb 1.0(1).
Since we’re at iWeb 1.1.1, it doesn’t work anymore as designed. This because iWeb 1.1.1 has a slightly changed TemplateInfo.plist file. There’s an extra entry for the version of the template. Being 1.0 Themes or 1.1 Themes. And a Blank page in every theme.
 
Meet site2template2
Now, I don’t know anything about Python. It’s just trying to understand the logic and the declarations to see if it can be altered to work with the new templates. So I tried once and got an error-message. A very logical one. I tried twice - and it worked. So now I can use it to convert a new style template into one carrying the name I want and alter it later.
 
Downloading site2template
Although part of the instructions are in the file, not everything was clear. So here it goes: instructions for the both of them... ensuring you’ll get a working version or versions. If you’re on 1.1.1, you need only to download the patched version. You know, like ctrl-click and choose “Download linked file”.
 
Installing site2template
NOTE: You need to be an Admin to do this...
  1. Open a terminal window. (its in your /Applications/Utilities folder.
  2. Type sudo cp with a space behind it.
  3. Go to the folder you have your freshly downloaded file in. Drag&drop the file on your terminal window.
  4. You now see the path and filename appear in the Terminal window.
  5. Type /usr/bin/site2temp behind it and press return.
You’re asked for your password.
 
Congratulations! You’ve just copied over the file that can help you create templates!

Now. let’s only make sure it can be executed as well. Still in the terminal, type the following command:
chmod a+x /usr/bin/site2temp
and press return.
If you get no error-messages, all’s well.
Whatever prompt you’re on, type in cd /usr/bin and press return
Then type in ls -l si* and press return
 
If you see it listed, it’s there!
Tadaaa.... first steps are completed!
 
Now make sure you can use it as a so-called executable as well..
Still in the Terminal, type: sudo chmod a+x /usr/bin/site2temp and press return.
If you’re asked for your password, type it in.
If all’s well, you get NO error messages.
Then type site2temp and press return.
If you get text like in the picture, it works!
 
NOTE: you need to use it in the Terminal as site2temp yoursite whereby “yoursite” is the sitename you’ve given your “empty” site.
 
Starting with a clean site
First, you need to be aware that site2temp ONLY works on the Domain.sites file residing in “~/Library/Application Support/iWeb”. This is the Library folder in YOUR home-folder. If you need to make it empty, here’s how that’s done.
  1. Make a backup of the file.
  2. Open it by double-clicking (the one in the folder described above!).
  3. Create a new site, name it to your liking. In this example I’ll use “Uitgelicht”.
  4. Choose a page you want to base your “empty” site template on, f.e. “Highlighted”.
  5. Start with “Welcome”.
  6. You see the Welcome page appear.
  7. Click your original site and choose in the Edit menu “Delete Site”.
  8. Now there should only be your newly created site.
  9. Choose “New Page” from the “Flie” menu.
  10. Double-click “About Me” and the About Me page should appear.
  11. Continue this process for “Photos”, “Movie”, “Blog”. “Podcast” and “Blank”.
You should have a site with 7 pages now. If not, you’ve done something wrong.
 
The new template....
Save your site and QUIT iWEB.
 
HALT! Shouldn’t you do a BACKUP FIRST???
Not to spoil anything, but you CAN destroy your TemplatesInfo.plist somehow, with the only thing saving you is to restore a CLEAN copy. Or at least a previous and working one.
So there are 2 things you can do:
1) make a copy of your current iWeb file in /Applications, preferrably to a different disk.
2) make a copy of the .plist file in a save place. It resides in... see picture on the left and ensure you use the language you’ve selected.
 
Next, go into the Terminal and type site2temp yoursite. Press return.
If all’s well.. you will NOT get an error message.
Start iWeb again, and choose “New Page” from the “File” menu. If all’s well, you can get a dialog like this, containing yoursite as an option to choose from:
 
This means you’ve WON!
 
At least, if the “New Page” DOES provide you with a new page. You now have successfully created a template with a name YOU picked, containing the pages from an original template. This means you now are able to edit everything you like in the .xml files and manipulate the contents of the templates to your likings.
At least.. if you follow the rules... ;-)
NOTE: I don’t care about thumbnails here... you’ve probably noticed already.
 
COPYING OVER... THE ORIGINALS.
What I normally do... and I advise you friendly to do the same, is copying over the ORIGINAL index files to you’re newly created template before you start modding them.
That means that there are 7 packages you need to open from your orignal template and 7 from your newly created template. And copy over the Index.xml.gz files one by one.
 
I don’t insist on it... but if you mod everything in a template and want to use site2temp again, you’d better have done this. Otherwise it may not work again and all your work is void.
Now, you don’t want that, do you?
 
EMPTY BOX
Now, what happened if you ended up with an empty box... iWeb didn’t respond the first time to “New Page” or “New Site”????
“Lucky you”... you’ve been hit by a bug, F* up big time your TemplatesInfo.plist file.
This is why you need to BACKUP this file! If you don’t, a fresh re-install or a fresh copy of the file is the only thing that can get you going again.
 
I DID warn you about this a few times, didn’t I?
 
WARNING! WARNING!
There were times I cursed... I used site2template and when trying to create a new page - it didn’t work the first time. The second time I chose New Page, I got an empty dialog box. You got the same?
Congratulations! You’re the owner -if you’re lucky- of a TemplateInfo.plist file iWeb can’t work with. Just lacking information or some corruption somewhere.
 
Corruption: Even when looking at it with TextEdit or the plist editor, all looks well... but still doesn’t work. Replacing the .plist file for a clean or backup copy may work. If you’re as lucky as I was at one stage, you have to replace your copy of iWeb.
 
See.... backup. Backup. Backup.
Keep copies in sequences - so you have a history to fall back upon. There’s nothing more frustrating than having to go back to a clean and original copy and start from scratch... after many, many hours of work.
Although.. quite often you can get away with a clean copy and copy your stuff back in.
More than once, I reverted to copy a clean file and manually edit a plist file to get the template back into operation.
Just don’t be afraid to try things out. Any worse then an already not working install is not possible, or is it?