As discussed in the first article of this two-part series on recoding iWeb sites, iWeb does not allow you to directly edit HTML code in the Web pages you create by using it. As a workaround, you can open the files using an alternate Web design application such as Dreamweaver, or you can use a text editor to add code or to modify pages. Part one of this series focused on locating the files that iWeb creates and showed you how to add very small pieces of code to them, such as the many free Web services—like blogrolls—require. This article goes looks more deeply at the actual HTML code that iWeb creates on individual pages.
Before getting into discussion about code, however, let’s talk about the reasons you might want to modify the code of an iWeb site. Sometimes you might be required to add a bit of code to a page for a specific service. You might also want to remove or modify items that iWeb automatically creates, most notably the navigation bar that it puts at the top of each page.
Beyond that, you may want to add Flash animation or Java applets, image maps, or forms to page. These types of elements are fairly common and basic enough that most people can place them on a page. There are tons of ready-made applets and scripts out there to add custom features to a Website without requiring you to know much about how the code actually works, but they are a little bit more involved than simply placing a single line of code into a page. Even if you are a proficient Web designer, you might choose to use iWeb because it is a quick and easy method for creating basic personal pages. Plus you still have the option to add more complex custom elements if you want.
iWeb’s user-friendly interface makes it an attractive tool for developing concept sites for clients or projects. If you’re a professional or semiprofessional designer, you might be called on to develop a handful of ideas to pitch for a new site or a redesign of a site in a short amount of time. iWeb can be a simple way to create those concept pieces for a design meeting. However, after a design is selected, you face the prospect of actually building a site with more functionality and cleaner code than iWeb allows. Similarly, you might initially create a site in iWeb and then determine that you need to use a broader set of tools for what you want to accomplish with that site.
Removing or Revising the Navigation Bar
Let’s start with the most obvious element that you might want to change in an iWeb site: the navigation bar. iWeb automatically creates this bar regardless of which template you use and it does so without any real consistency from one template theme to another. Also, unlike some of iWeb’s required text boxes, you cannot alter the navigation bar (although you can specify whether each page is displayed in it). Although the navigation bar is a nice feature, it is also one of the things that marks a site as obviously having been created using iWeb, and the variation between themes prevents you from having a consistent look at the top of each page throughout your site (unless you choose a single theme).
Each graphic and link/mouseover effect section is contained within its own <div> tags. The link and mouseover sections can be identified because they begin with an anchor (<a>) tag and contain items such as onmouseout="NBmouseout(’11’) and onmouseover="NBmouseover(’11’). After the last of these sections, there’s a single </div> tag and then the content of the rest of the page.