Change iWeb Hyperlink & Navbar Colors

October 25, 2006

This article applies to iWeb 1.0 ONLY. A similar document for iWeb 2.0 theme customization can be found here:

Customize iWeb Themes and Edit XML

I continue to see people stating that it’s impossible to change hyperlink colors and navigation menu colors until after you publish your site. This is not true. It’s quite easy to update your templates with the colors YOU want and when you update the template, you never have to mess with any post-processing. You make a new page? Your colors are already there.

I’ve gone over this before in this thread but I’ll go over the quick and dirty version here as well. Those who want more detail can post a question and I’ll elaborate.

First, do you know how to get into iWeb’s inner folders? You right click or control click on your iWeb icon and select Show Package Contents from the pop-up menu.

Step 2

Once you’ve done that, you’ll see a new Finder window that shows a folder called Contents. Open that and then open the next folder Resources. Within Resources there’s a folder named Shared. Open the Shared folder.

You’re now looking at your collection of iWeb template files. You’ll notice that each template has seven individual page files – each file defines the layout and styles for the page for which its named. This is actually one of the two places where you’ll find the data/images that make up your iWeb pages. This location only contains the images. Now I’ll show you were to find the data file.

So you’re currently here:

/Applications/iWeb/Contents/Resources/Shared/

You want to go here:

/Applications/iWeb/Contents/Resources/English.lproj

Now if you speak another language and your Mac’s system language is set to the language you speak, substitue English with that language. If your system is set to English regardless of the language you speak, and you use the English templates, then stick with the English folder.

When you’re in the English.lproj folder, you will see seven sub-folders and one file named TemplatesInfo.plist. TemplatesInfo.plist is the file that registers the templates and tells iWeb what you’ve got in your collection. But we don’t care about that file for now. We’re after the template data files.

The seven sub-folders are aptly named for each of the seven page-types as you can see. Open the About Me folder.

Now you will see an “about me.webtemplate” file for every template you have in your collection. Good job. You’ve learned something new. Move on to Step 3.

Step 3

If you haven’t decided yet, now’s the time to decide which template you’d like to update. If you’re just along for the ride to learn something new, no worries. We won’t do anything you can’t undo.

Pick a template file now. Perhaps you chose the White template, or:

White About Me.webtemplate

Right click or control click on this file and select Show Package Contents from the pop-up menu. This will launch a new Finder window that displays the contents of the White About Me.webtemplate file.

You will likely see a handful of different files, but the file you want is the one named Index.xml.gz.

Index.xml.gz is the brain behind the template. Within this file are all the settings for the page you chose and it’s really not hard to find what you want and change it. So let’s take a peek.

Step 4

Double-click the file Index.xml.gz. This will reveal a new file named Index.xml. You might have to scroll down in your Finder window to see it. Rename Index.xml.gz to Index.xml.gz.backup in case you screw things up, you have your original.

Now, open Index.xml with TextEdit. Do not open the file with a code editor unless you have already formatted the file.

When the file opens, you’ll notice it’s one gigantic jumbled mess of stuff. No worries, we’ll straighten that out. All you need to do is a find/replace.

Find all instances of: ><

And replace with:

>
<

The line break is important so maybe just copy the lines right out of this post. When you replace all of those, the file will be far more easy to view.

Assuming you’ve completed that step. You’re basically ready to make your change and test it out! Not hard ey?

So let’s say you want to change your hyperlink color from grey to blue. Search for this string:

BLDefaultHyperlinkCharacterStyleIdentifier0

When you find that string, you will see a few lines below it, two lines that look similar to this:

<sf:fontColor>
<sf:color xsi:type=”sfa:calibrated-rgb-color-type” sfa:r=”.8″ sfa:g=”1″ sfa:b=”0.4″ sfa:a=”1″/>

This is how the template specifies color. It’s RGB100. Your Mac came with a program called Art Director’s Took Kit and that application can tell you the RGB100 values for any color you want. Tinker with that and you’ll have a lot of fun with this.

So I picked out a nice royal blue for you. The RGB100 values for it are:

R:0 G:25 B:100

What you need to do is update the color line to match those values:

<sf:color xsi:type=”sfa:calibrated-rgb-color-type” sfa:r=”0″ sfa:g=”.25″ sfa:b=”1″ sfa:a=”1″/>

Notice that you specify these in terms of a percentage, where 25 became .25 and 100 became 1.

Step 5

Save your file. It’s time to see your work in action. Open iWeb if it isn’t open already and create a new page using the template you’ve just altered. If you altered the White About Me page, then select that and create the new page.

It there are hyperlinks already on this page, you should already see that they reflect your new color. If there aren’t any hyperlinks, then type some text and create one. You should see your new link color right away!

Now if you don’t see the new color, either you picked the wrong page or you neglected to rename the Index.xml.gz file a few steps back. If you did not rename that file, then it’s still in control of your template. Rename it now and try again.

If you don’t like that color, simply swap back to the TextEdit page and change it until you like it – switching back and forth between the file and iWeb to view your changes. Once you’re happy, make note of the color you chose and make the change for the remaining six pages in the tempalte you selected. Just be sure to follow the steps for each page you edit. If you fail to see your change, again, check to see that you renamed Index.xml.gz.

Side Notes

You might want to duplicate and rename an entire template. If you’re pretty good within Finder then go for it, just be sure that you duplicate the files in both locations:

/Applications/iWeb/Contents/Resources/Shared/
/Applications/iWeb/Contents/Resources/English.lproj/…

Choose a unique name for the duplicated template and change every single file so that the new name replaces the old one. You would have to register this new template in the TemplatesInfo.plist file as well, but I’m not going to get into that here.

The thread I referenced at the top has all kinds of search terms to find the other hyperlink styles (rollover and visited) and all the navigation menu styles plus a bunch of other fun stuff.

Now, it seems long, but that’s because I wrote it well. The shortest version of this I’ve ever written was two sentences, but that was for a UNIX geek and he got it. It’s just as easy for you, but I write it out so that anyone can do this, because anyone can. It’s just not hard.

If you have questions about any of the steps, go ahead and ask.


About This Article

This entry was posted by on Wednesday, October 25th, 2006 at 9:48 AM and was filed in the Solutions category using the tags: , . You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.



120 Responses to “Change iWeb Hyperlink & Navbar Colors”

  1. LolaCanada wrote:

    Hello, this question is regarding the removal of underline formatting on hyperlinks. Following the previous instructions and using MassReplaceIt, I was able to successfully change this but only in the blog template. Doing the exact same thing for either the photo or blank or other templates does not work. Are the lines we need to change in these templates the same in all cases?

  2. tobybirney wrote:

    Hi Suzanne,

    The link in your original post is dead. I’m interested in changing the font and the font spacing in my navigation menu. Also, I’d like to change the font used on my main blog page as well as to make it justified… Any suggestions?

    Thanks,
    Toby

  3. Dave Arnold wrote:

    Hi, Yeah, how do i change the FONT and FONT-SIZE of the nav text? Iv successfully changed the color, but now i want to change the font.
    Thanks!
    Dave

  4. Suzanne wrote:

    Dave, I think I responded to your email for this one, but for others, search for:

    navbar-pargraph

    Yes, the word paragraph is spelled wrong in the XML so search exactly how I wrote it there. The font and font size are specified in that section.

  5. pherplexed wrote:

    Great tutorial! I’ve been tweaking and making all kinds of changes successfully, but two things are stumping me. 1) None of my images are showing up. I’ve made the changes in the xml file, placed the images in the /shared/template name folder and put aliases for them in the /english.lproj/templates/template name folder. What am i missing?

    2)I replaced the header image in the xml file for my blog page, but it still shows the header image-area as a placeholder…not just the image (maybe this problem will go away if my first problem is solved?)

    Thanks again…great work!!

  6. Suzanne wrote:

    You forgot to rename index.xml.gz.

  7. pherplexed wrote:

    That’s what i thought it was, but I’ve actually removed the index.xml.gz file. All my other changes are showing up (font styles and colors, image placements, etc) but the images themselves won’t show up. Any other thoughts?

  8. Suzanne wrote:

    Well there’s only two reasons why an image wouldn’t show up and that’s:

    1. you forgot to change the filename of the image so it matches the name in the XML (or vice versa), or,

    the XML is wrong, i.e. missing necessary elements to make the picture appear

    If you’re going to swap images, it’s best NOT to mess with the XML at all and simply just replace the images that are in the folder already. Place your image in the folder, delete the original, but make sure your new image has the name of the original because obviously, the XML is looking for THAT filename.

  9. tobybirney wrote:

    thanks for all the info, Suzanne…

    I’ve figured out how to change the font on the navigation menu with your help.

    But I’m still wondering- how can I adjust the character spacing for the text in the navigation menu?

    Also, what about the font used in the Blog- what section is that under in the XML file? I’d love to change that as well instead of going with the preset template font…

  10. Suzanne wrote:

    Toby, here’s the code for controlling kerning of letters.

    <sf:tracking>
    <sf:number sfa:number=”-0.02″ sfa:type=”f”/>
    </sf:tracking>

    The font in the blog has been covered many times on the iWeb forums at Apple and I’m sure in my comments here.

  11. tobybirney wrote:

    thanks Suzanne,

    I’ll look for the iWeb forums and will explore your site for more answers. Best!

  12. Tania T wrote:

    Hi, I was in process of following your direction to change the font colors for the nav bar as well as the hyperlinks and I got stuck trying to decrompress the Index.xml.gz file!! The file will not decrompress with Stuffit 10.0 or 11.0. Any suggestions how to get over this speed bump? Thanks very much in advance!!

  13. Suzanne wrote:

    All you have to do is double click the file to decompress it Tania. Then look through the entire folder for the decompressed version index.xml. It doesn’t necessarily appear next to the original.

  14. Tania T wrote:

    Thank you for writing back, Suzanne. Still not working. I briefly see the Stuffit window pop up when I double click but then… nothing. Im on OS 10.3.9. Does it have anything to do with that? Thank you in advance!!

  15. Tania T wrote:

    Hi Suzanne,
    I pulled a copy of the Index.xml.gz file to the desktop, double clicked and received a file named /tmp/tarball.O0ouQxD1/About Me/Watercolor About Me.webtemplate/ndex.xml
    Am I good to proceed with this one? Did not get a simple one just named index.xml, yikes!