Customizing the Template
The family/personal website template shown in Figure 3.1 provides bare-bone web pages that you can easily add to and customize to create your own unique family/personal website. If you like the look and feel of the template, all that’s left to do is to customize the template’s content, replacing the current text with the text pertinent to you and your family, and the image in the upper-left corner with an image of your own choosing.
"When working with the template, you may find that you want to customize certain aspects. ... Fortunately, Composer makes customizing the template quick, fun, and easy."
When working with the template, you may find that you want to customize certain aspects. For example, you might want to change the template’s font, or alter the text or background colors. You might want to add additional web pages to the template, such as a web page that lists important dates (anniversaries, birthdays, and so on). You might want to remove pages from the template; perhaps you don’t want a favorite recipes page.
Fortunately, Composer makes customizing the template in any of these ways quick, fun, and easy. In this section we’ll be examining a myriad of ways to customize your template. When working with the template files, keep the following two things in mind:
Composer is like any other word processor. If you want to customize the page by centering some text, for example, simply select the text to center and click on the Center icon in the Toolbar, just like you would to center text with Microsoft Word.
Have fun customizing the templates, and don’t be afraid to experiment! Keep in mind that since you’re working with the template files on your computer’s hard drive, no matter what you do, you can’t irreparably screw up the template. There will always be a pristine copy of the website’s template files on the book’s CD that you can recopy to your computer should the need arise.
With that, it’s time to get started examining how to use Composer to customize the family/personal website template!
Changing the Upper-Left Image
Each page in the family/personal website contains an image in the upper-left corner of my dog, Sam. You are invited to add your own image here, such as a picture of yourself, your family, or your family’s pet. To replace the picture of Sam with a picture of your own, you’ll need to have the picture on your computer’s hard drive. In the "Customizing the Family Pictures Page" section you’ll learn how to get pictures of yourself or family onto your computer, so that you can add them to your website’s pages.
To customize the upper-left image, first copy the image you want to replace it with into the same folder that you copied the website template files to. Next, launch Composer if you have not already done so. (Recall that this involves starting the Mozilla Browser, and then going to the Window menu and choosing the Composer option.) Next, open the template’s homepage file, index.html, in Composer. This is accomplished by either clicking the Open icon in the Toolbar or by going to the File menu and selecting the Open File menu option.
Once you have opened the index.html page in composer, your screen should look similar to Figure 3.2.
To change the image of Sam to an image of your own, you’ll need to open the Image Properties dialog box for the image. This can be done in one of a number of ways: by right-clicking on the image and selecting the Image Properties menu option; by double-clicking the image; or by single-clicking the image and then clicking on the Image icon in the Toolbar. Using any of these approaches will display the Image Properties dialog box (see Figure 3.3), from which you can customize the information about the displayed image.
The next section, "Specifying Image Properties," steps through the four tabs in the Image Properties dialog box and discusses how to replace the image of Sam with an image of your own. Keep in mind that you’ll need to replace the image of Sam with your own image for each web page in the family/personal website template.
Specifying Image Properties
The Image Properties dialog box contains four tabs: Location, Dimensions, Appearance, and Link. These tabs contain settings to customize the selected image’s properties. Let’s look at each of these tabs one at a time.
Figure 3.2 The index.html file has been opened with Composer.
Figure 3.3 Customize the image from the Image Properties dialog box.
The Location Tab
The Location tab, shown in Figure 3.3, allows you to specify the file to display. To change the upper-left image from one of my dog to one of your own, click on the Choose File button and select the image you want to display. Upon doing so, a small preview of the image selected will appear in the lower left corner of the Image Properties dialog box.
Next, from the Location tab, you can set the Alternate text for the image. This is the text that is displayed in the image’s place for those visitors who are using text-only browsers or who have configured their browsers to not display images. Realistically, very few web surfers fall into this category, so feel free to simply not provide any alternate text. If you decide not to provide alternate text, be sure to select the Don’t use alternate text radio button.
The Dimensions Tab
The next tab, Dimensions, allows you to customize the width and height of the image. As Figure 3.4 shows, the Dimensions tab has two radio buttons: Actual Size and Custom Size. If you leave Actual Size selected, the image will be displayed in its actual size. If you click Custom Size, you can specify the image size in either pixels or as a percentage of the browser’s window.
Figure 3.4 The image’s size can be configured in the Dimensions tab.
The picture of Sam is scaled to a width of 170 pixels and a height of 166 pixels. As shown in the Image Preview section at the bottom of the dialog box in Figure 3.4, the actual image size is 321 pixels by 313 pixels.
Oftentimes an image will be resized so that it fits nicely on a page. The full-sized image of Sam is too large to fit nicely in the web page, hence it is scaled down to 170 by 166. When scaling images yourself, make sure to check the Constrain check box. This check box, if checked, makes sure that the ratio between the resized width and height remains the same as the original image’s width and height ratio. By leaving this check box checked you ensure that resizing your image won’t result in an image that is squished too fat or too thin.
When adding your own image, scale it so that it is at least 166 high. The family/personal website was designed to display an image precisely 166 pixels high. If you make the image shorter than 166 pixels, there will be whitespace beneath the image. When adding your own image, I would recommend that you
Select the Custom Size radio button.
Check the Constrain check box.
Enter 166 as the height.
The Appearances Tab
The Appearances tab (shown in Figure 3.5) allows you to configure how the image will appear within text. The Spacing section lets you specify how much spacing should appear between the left and right and top and bottom of the image and the text around the image. The Solid Border text box permits you to specify whether the image should have a border and, if so, how many pixels wide it should be.
Additionally, you can choose how to have the text aligned with the image. You can have the following text appear at the bottom of the image, the center, or the top. Alternatively, you can have the image flow within the text on the left or right.
For the family/personal website, I’d recommend not changing the values in the Appearances tab, as the template was designed to have no spacing around the image.
Figure 3.5 The Appearances tab specifies how the text and image coexist.
The Link Tab
The final tab, the Link tab, allows you to specify a hyperlink for the image. That is, you can indicate that when the image is clicked, the user be whisked to a particular URL. A screenshot of the Link tab is shown in Figure 3.6.
Figure 3.6 Use the Link tab to link the image to a URL.
Table 3.1: A Summary of the Image Properties Dialog Box’s Tabs
Tab |
Description |
Location |
Choose the image to display from the Location tab. You can provide a Tooltip, which will be displayed when a visitor hovers her mouse over the image. Also, the Location tab allows you to specify an Alternate text, which is displayed in place of the image for those visitors whose browsers don’t support images. |
Dimensions |
From the Dimensions tab you can indicate a custom height and width for the image. |
Appearance |
The Appearance tab allows you to indicate the top, bottom, left, and right spacing around the image (if any), along with how text flows around the image. |
Link |
You can configure your image so that when a visitor clicks it he is whisked to a different web page. If you want to enable this behavior, specify the URL to send the user in the Link tab. |
Removing the Image Altogether
While some readers will like having a picture shown on each page, others might not want a picture shown at all. Fortunately, Composer makes it a cinch to remove the image from the upper-left corner. To strike the image from the web page altogether, simply right-click on the image and choose the Delete menu option.
Changing the Font
The text in the web page templates is displayed using a Verdana font. You can easily change the font for any text in Composer with the following steps:
Select the text whose font you want to change. The easiest way to do this is to place the mouse at the beginning of the text you want to select, and, holding down the mouse button, drag the mouse cursor until the text you want to modify is completely selected.
With the text selected, go to the Format menu. Choose the Font menu option and then pick a font from the list.
You can also change other text properties—such as the text color and style—through the Format menu. For example, imagine that you wanted to change the foreground color of the header text for a web page. (The header text in the homepage is "Welcome to the Mitchell Family Website!" and is displayed in a turquoise color.) To change this text’s foreground color to, say, red, you’d first select the text and then go to the Format menu and choose the Text Color menu option. This will display the Text Color dialog box (see Figure 3.7), from which you can select a new foreground color.
Figure 3.7 Pick the text’s foreground color from the Text Color dialog box.
To make the font bold, italic, or underlined, first select the text and then go to the Format menu’s Text Style menu. From there you can see the various formatting options.
Adding and Removing Pages from the Template
The family/personal website template comes with four web pages: a homepage, a family pictures page, a recent events page, and a favorite recipes page. As we discussed earlier, though, you might very well want to add additional pages, or remove some of the pre-packaged pages.
Removing a page from the site simply entails removing the links from the other web pages to the page you wish to snip from the site. For example, imagine that you didn’t want to have a favorite recipes page on your family/personal website. To accomplish this, you’d need to open the homepage, family pictures page, and recent event page in Composer, and remove the link at the top to the Recent Events page. Removing the link is as simple as selecting the link text and hitting Delete.
To add a new page to the template, you need to create a new web page whose look and feel mimics that of the other pages in the template. Creating a new web page using the template can be done in one of two ways:
By creating a new web page in Composer, and then copying and pasting the entire contents of a template page to the new page, or
By going to the File menu and choosing the Save As menu option, which has the effect of saving an existing template web page with a different file name.
Once you have created the new web page and inherited the template’s look and feel, you can customize the page’s content as needed. For example, if you added an additional page that listed important dates for your family, the content for this page would include the dates and their meanings (anniversaries, birthdays, graduations, and so on). After you have created the content for the new page, save the web page by going to the File menu and choosing the Save menu option.
Once you have created and saved the new page, the next step is to add a link from all other web pages in the site to the new page. As Figure 3.1 showed, each page has a list of links along the top. You’ll need to add a link up top to the new page you created.
To add a link, start by clicking your mouse where you want the link to appear, perhaps between the Family Pictures and Recent Events links. Next, type in the text for the link, such as "Important Dates", followed by a period, which is used as a separator between each link.
The final step is to link the text you just entered to the new web page you created. To accomplish this, select the text you just added, go to the Insert menu, and choose the Link menu option. This will display the Link Properties dialog box, shown in Figure 3.8.
Figure 3.8 Select the page to link to using the Choose File button.
From the Link Properties dialog box, choose the file you want the user whisked to when they click the link. Since this link needs to take the user to the newly created page, click the Choose File button and select the page you added just a moment ago. Finally, click the OK button to create a hyperlink to the newly created page.