Professional Documents
Culture Documents
by Christopher Heng, thesitewizard.com For those who don't know, Adobe Dreamweaver Creative Suite 4 (CS4), is a well-known commercial web editor that enables you to design, build and manage complex websites. The editor is a What-You-See-Is-What-You-Get (WYSIWYG) web editor, which means that you can create your web page visually and whatever you see on the screen while designing is what you will get when your site is loaded in a normal web browser. As far as WYSIWYG web editors go, Dreamweaver does a very good job of generating standards-compliant code for web pages. This means that your site will not break in newer versions of web browsers. For the technically inclined, the HTML and CSS code that it creates for your website will validate correctly.
Dreamweaver
Since this is a Dreamweaver CS4 tutorial, it goes without saying that you will need the editor itself. Note that this tutorial assumes that you are using Dreamweaver CS 4. Dreamweaver CS5.5 users should read the Dreamweaver CS5.5 Tutorial, Dreamweaver CS5 users the Dreamweaver CS5 Tutorial and Dreamweaver CS3 users the Dreamweaver CS3 Tutorial. While CS3, CS4, CS5 and CS5.5 have some similarities, there are still enough differences between them that it will be much easier to just use the tutorial specifically written for the version that you have. Those using earlier versions of Dreamweaver, like Dreamweaver 8, will need to upgrade to the current version to use this tutorial. The earlier versions are missing key features that will prevent you from completing any of the CS3, CS4, CS5 and CS5.5 tutorials.
Although not in the above list (since you don't need it to succesfully complete this tutorial), I also recommend that you register your own domain name. A domain name is a name like "thesitewizard.com". It is a means by which people can reach your website. While it's possible for you to get by initially without your own domain, you will encounter innumerable problems down the road if you do so. However, since this tutorial is strictly devoted to designing (creating) and publishing your website with Dreamweaver, I shall leave not delve further into this matter. Instead, I will refer you to the Beginner's Guide mentioned above for this and all the other non-design aspects of creating a website.
Near the top of the window is a menu bar with the words "File Edit View Insert Modify Format Commands Site Window Help". This menu bar allows you to access many of Dreamweaver's features. We will be using this menu bar extensively in the course of the tutorial. 3. To create a website that you can manage using Dreamweaver, the first thing you should do is to invoke the Site Manager. To do this, click "Site" in the menu bar. When the drop-down menu appears, click the "New Site..." item on that menu. Important note: in the interest of brevity, I shall refer to such a sequence of clicking the "Site" menu, followed by clicking the "New Site..." item simply as "Site | New Site..." 4. A dialog box will appear with a title bar that reads "Site Definition for Unnamed Site 2". The actual number that follows the word "Site" may be different if you have ever used Dreamweaver to set up a site before. Don't worry about that. You are about to change it anyway. If you were to look at the top of the dialog box, you will see two tabs: the "Basic" and the "Advanced" tab. You should currently be using the "Basic" tab. If this is not true, click the "Basic" tab to select it. If you don't know which is currently selected, click the "Basic" tab to be sure. In the main part of the dialog box, you should be able to see a field just under "What would you like to name your site?" This is where you enter your website's name. If you're not sure what to call your website at this point, and you have already registered your own domain name, simply enter your domain name here. For example, if you have bought a domain called "example.com", enter "example.com" (without the quotation marks) into the box. If you're creating a company website, enter your company name instead. Don't worry too much about this field: it's merely for your own personal reference in case you create many websites and need to distinguish between them. The words typed here won't appear on your site. For the purpose of this tutorial, I will assume that you have typed "Example Company" into the box. However, there's no need for you to use this name just because you're following this tutorial. Use your site's real name. Underneath your site's name is a field for you to enter the web address of your website, following the question "What is the HTTP Address (URL) of your site?". If you have bought the domain "example.com", enter your website address as "http://www.example.com/" (without the quotes), unless your web host tells you otherwise.
3
Once you've finished entering the above two fields, click the "Next" button at the bottom of the window. 5. In the next screen that appears, accept the default "No, I do not want to use a server technology" and click the "Next" button again. 6. The next window that appears lets you to control where Dreamweaver saves the files you create. The default is to place the files in a folder with the same name as your website. You can change the location if you wish. Note that this folder merely determines where on your computer the website files are saved. You will be taught how to publish those files to your web host in a later step. You should always keep a copy of your website on your own computer. If you don't know what to do here, just accept the default and click "Next". 7. When the window with the question "How do you connect to your remote server?" appears, click the down arrow in the drop-down box and select "None". You will change this later when you publish your site, but for now, selecting "None" allows you to quickly get started with your site with minimum fuss. Click the "Next" button. 8. You will then be presented with a "Site Definition" summary. Click "Done".
How to Create a Two Column Web Page with Header and Footer in Dreamweaver CS4
Now that you have provided Dreamweaver with the basic information needed for it to manage your website, you will now create your first web page. For the purpose of this tutorial, we will create a two-column web page. By 2 columns, I mean that the page will have two vertical columns. This is a popular layout among many websites because it is both space-efficient and familiar to users (and as a result of that, user-friendly). One of the columns is usually used to hold the site's logo and navigation menu while the other column the main content. For example, if you were to look at any of thesitewizard.com's article pages, like the one you're reading, you will see that the left column contains the navigation elements while the right column contains the article itself. 1. Click "File | New...". If you remember what I said earlier, this means to click the "File" menu, followed by the "New..." item on the menu that appears. A window with the title "New Document" will appear.
2. In the Layout column of the window, locate the line that says "2 column liquid, left sidebar, header and footer". Select that item by clicking it once. 3. Now glance at the rightmost side of the same window and look for the item "Layout CSS". It should be somewhere near the bottom of the window. Click the drop-down box and select "Create New File". This causes Dreamweaver to place information controlling the appearance of your web page (called "CSS") in a separate file. We want this because all the pages on your site will share the same basic layout, and having such information contained in a single file saves disk space, bandwidth and speeds up the loading of your web page if your visitors load multiple pages of your website. 4. When you've finished doing the above, click the "Create" button. 5. Dreamweaver will issue a dialog box with the title "Save Style Sheet File As". Accept the default name and location by clicking the "Save" button. 6. Once you've done that, Dreamweaver will proceed to create a 2 column web page with some dummy content typed in. 7. Dreamweaver CS4 displays a slightly different screen layout depending on how large your monitor resolution is. If your screen resolution is large, Dreamweaver may start up in what it calls the "Split" mode, that is, it may show the underlying "raw" code of your web page in the top half of the window (the "Code" portion), and the visually pleasing version (the "Design" portion) in the bottom half. If your screen is smaller, Dreamweaver will simply start up in "Design" mode, where only the visually pleasing version is displayed. To standardize the appearance of the Dreamweaver window, for the sake of this tutorial, please click "View | Design" from the menu if you're in the "Split" mode. If you're not sure which mode you're in, just click "View | Design" anyway; no harm will come from doing it. This switches the layout to "Design" mode, where only your web page, as it appears in a browser, is shown. Don't worry. If at any time, you feel nostalgic for the original "Split" layout, just use "View | Code and Design" from the menu to get it back. Note, however, that all the steps in this tutorial, as well as the screenshots, assume that you are in the "Design" mode, so if you don't switch, you might get confused later when the screen doesn't appear the way I describe it.
visitors to individual product description pages where they can find more information about the product and place an order. Even if your site is a personal website, you will still want your main page to give visitors an idea of what to expect on your site, and to link to other pages (or at least the main sections) on your site. For this tutorial, I will supply example text for a fictitious company called "Example Company", selling fictitious products. I strongly recommend that you use your own text instead of slavishly copying my supplied dummy text. For example, if your company is called "XYZ Inc", go ahead and use "XYZ Inc" in places where I use "Example Company". Similarly, if you're making a personal website, and have named your website after you, such as "Shakespeare's Website", substitute that name in places where I use "Example Company". The same goes for the actual content.
Click somewhere in the word "Untitled", and use the delete or backspace key to remove the existing text. In its place, type the name of your website. For example, if your site is called "Example Company", replace "Untitled Document" with "Example Company". Note that this title field is an internal field. The web browser does not display it in the body (visible portion) of your web page. As mentioned above, the field is only shown in the title bar of the browser window itself. If you're not sure what I'm talking about, look at the browser window of this tutorial now. Don't use the scroll bar nor scroll to the top in any way. Just glance upwards at the top edge of the browser window. It should have the words "Dreamweaver CS4 Tutorial: How to Create a Website with
6
Dreamweaver CS4 (thesitewizard.com)" or at least the first part of it. I placed those words into the title field for this page when I created it. Although it doesn't show in the body of a web page, it is still an integral part of the page, so you should not leave it set as "Untitled Document". 3. Now we move on to the visible portion of your web page. Begin by replacing the word "Header" with the name of your website. As before, you can do this simply by clicking somewhere in the word "Header". A blinking text cursor will appear. This text cursor behaves exactly the way the cursor behaves in a normal word processing program like Office or Word. You can move it with your arrow keys as well as use the DEL and backspace keys to delete characters. Use the delete or backspace key to remove the existing word and enter your site's name instead. For example, replace "Header" with "Example Company" if that's the name of your site. 4. Once you've figured out the above, it's a trivial matter to replace the "Main Content" section of the web page with your real content. As before, click somewhere in the words "Main Content", delete the existing text and replace with some appropriate content. Once you're done with replacing the "Main Content" header, proceed to replace the "Lorem ipsum dolor" (etc) gibberish. Just click somewhere in the top line, delete them, and type your own words. Typing and editing of text in Dreamweaver works more or less the same as it does under a wordprocessor. If you need to create new paragraphs, hit the ENTER (Windows) or Return key (Mac). The "H2 level heading" subtitle is there merely to show you that you can have subtitles in your documents as well. Replace it, along with the text below with whatever you want. If you are really at a loss as to what to type, you can use the following example text, either literally or as a model. However, it's best to write something relevant to your website so that you don't have to go back and re-edit it later.
Welcome
Example Company deals with all manner of examples. We have examples of literary works, pulp fiction, text books, movie reviews, scripts, chairs, tables, household appliances, and so on. We even have examples of examples.
Featured Product
Dreamweaver Site: This is an example of a Dreamweaver site, created with the help of thesitewizard.com's tutorial on Dreamweaver. The tutorial teaches you how to create a basic but fully-functional website which you can modify and augment to suit your needs. 5. Don't change anything in the left column (sidebar). You will be adding a navigation menu to this section in later chapters, so just leave it unchanged for now.
7
6. Scroll down to the bottom of the page and locate the horizontal bar labelled "Footer".
Replace the word "Footer" with anything you like. Many webmasters place a copyright notice in this section. Very briefly, a copyright notice is simply a sentence like "Copyright 2008 by Christopher Heng". The copyright symbol, , can be inserted by clicking "Insert | HTML | Special Characters | Copyright" from the menu. For more information about copyright, see my other article on Copyright Issues Relevant to Webmasters, at http://www.thesitewizard.com/general/copyrightissues.shtml 7. Once you're satisfied with your web page, save it by clicking "File | Save As...". A dialog box will appear. Type "index.html" (without the quotation marks) into the "File name" field and click the "Save" button. IMPORTANT: make sure that you type the name "index.html" exactly as I gave it, entirely in small letters (lowercase) with no spaces in the word. Do not use any other name. Files with the name "index.html" are regarded as special files by most web servers. Published correctly, when a visitor accesses your website by just the domain name, like "http://www.example.com/", the web server will automatically deliver to them the "index.html" file in your site's main folder.
when you first signed up for a web hosting account. Web hosts typically send you a lengthy list of details about your account when you first sign up. Among these is something known as your "FTP address". FTP, or File Transfer Protocol, is the usual means by which you transfer your web pages from your own computer to your web host's computer. This act of transferring your files from your computer to your web host's computer is variously known as "uploading" or "publishing". If your web host sent you the information in an email message, either print the message out or open it in another window so that you can refer to it. Personally, I think opening it in another window is better because you can then cut and paste the necessary information from one window to another and avoid typing errors. However, everyone has their own way of working, so do what suits you best.
4. Put the FTP address that your web host gave you into the answer field of the "What is
the hostname or FTP address of your Web Server?" question. If you have your own domain and are hosted on a commercial web host, this address is typically your domain name prefixed by "ftp". For example, if your domain is "example.com", many web hosts will set up your FTP address to be "ftp.example.com". Check the email you received from your web host for this information, or ask them if you cannot find the details. If the address is indeed "ftp.example.com", enter that in the box here. (Note: not all web hosts follow the "ftp.example.com" convention. Some web hosts ask you to simply use your domain name (ie, "example.com") for the FTP server. Others provide you with a hostname that is totally unrelated to your own domain. Make sure you really read the information given by your web host instead of randomly guessing a value to enter here.) 5. The next question from Dreamweaver that you'll need to answer is "What folder on the server do you want to store your files in?". Basically, you cannot simply upload (publish) your files into any folder you like on the web server and hope that they end up in the correct directory for your website. Some web hosts tell you that you need to place your web pages in a folder called "www". Others require you to publish them
into a folder called "public_html". Still others say that you should place them in the default directory that you see when you connect by FTP. If your web host tells you to simply upload the files when you connect via FTP, leave the box blank. Otherwise if they tell you that you need to publish your files in a "www" directory or some other folder name, enter that folder name in the box given. If the host does not mention this at all, chances are that you can simply leave the box blank. 6. Type your FTP user name into the "What is your FTP login?" field. As before, this information has to be supplied by your web host. 7. Enter your FTP password into the "What is your FTP password?" field. Obtain this password from your web host if you don't already know it. If you don't want to have to keep entering your password every time you publish a page, leave the "Save" checkbox activated (it automatically becomes checked when you type your password). If you are sharing your computer with others, and don't want Dreamweaver to save your password, click the check mark to uncheck it. 8. If your web host tells you that the information you entered above is for SFTP or "Secure FTP", click the "Use Secure FTP (SFTP)" checkbox. Otherwise leave it blank. If you don't know what to do, and your web host didn't say anything about it, leave it unchecked. (Note that if you check the secure FTP option, make sure you re-look at the information provided by your web host to make sure that the default folder to publish your files is still the same. Some web hosts log you in to a different folder when you connect by SFTP from the one you get when you connect by FTP. As such, you may have to adjust the folder name to account for this if you use the SFTP option. In general, if you are confused or not sure, just leave the box unchecked to use normal FTP. You can always experiment with this option in the future when you've become more experienced and confident with publishing using Dreamweaver. For now, let's just get everything working first.) 9. Click the "Test Connection" button to check that you have entered all the information correctly. Note: If you use Windows Vista, the Windows firewall may issue a message asking you whether to block or unblock the connection. Be sure to click the "Unblock" button, or you'll be blocking FTP connections for Dreamweaver. By default, FTP connections are two-way, requiring the server to which you're connecting to make a connection back to you, hence the warning by the firewall. This is normal, so don't panic when you get that message from Vista. The interference by the firewall may also cause your first test in Dreamweaver to fail, leading Dreamweaver to issue a dialog box telling you to use Passive connections. Just click OK to that message, and click the "Test Connection" again. If the "Test Connection" button fails, Dreamweaver will display a dialog box asking you to try connecting with Passive FTP. To do this, look at the top of the dialog box to locate the "Advanced" tab. Click it. Somewhere in the middle of the page is a checkbox for "Use passive FTP". Click the box to activate it. Then click the "Basic"
10
tab at the top of the dialog box again, to return you to the wizard view. Finally, click the "Test Connection" button again. If the test continues to fail, it is possible that you've entered some information incorrectly earlier. Recheck everything. If in doubt, contact your web host and ask them what information you need to enter for each field. (Only your web host has such information.) If the test succeeds, click the "Next" button until you get to the final Summary page again. Then click the "Done" button. Do not click the Cancel button for a shortcut out of this dialog box or you may have to re-enter everything you typed in earlier. 10. Click "Done" again to dismiss the "Manage Sites" dialog box. 11. Now that you've properly configured Dreamweaver for your site, it's time to finally publish your web page. To do this, click "Site | Put". Dreamweaver will issue a variety of messages to let you know the progress of the upload. When Dreamweaver pops out a message asking you whether it should "Put dependent files?" answer "Yes". This merely means that it is to upload things like your images and CSS files that are required by your web pages.
11
To fix the error, simply click "Site | Manage Sites..." and "Edit" and click the "Next" button till you get to the appropriate screen to modify. If you get no errors at all, but see the page that you've designed earlier, congratulations! You have created and uploaded your first web page using Dreamweaver CS4. It may be a rudimentary page (for now) but you have successfully walked through all the essential stages of designing and uploading a web page.
12
If you don't already have a logo, you should create one to use here. For things like logos, it's best not to use one of those free images you see on the Internet, even if the author says that you can use it royalty-free on your site. You will want your logo to be unique to your website, and not something other sites also sport. You can create logos either by drawing them on paper and then scanning them, or by using a drawing program or an image editor such as one of the free ones found on the Free Drawing and Painting Software, Image and Photo Editing Programs page. For those who have never created a logo before and are not sure how to even start, take a look at the article How to Create a Logo for Your Site the Quick and Easy Way found at http://www.thesitewizard.com/webdesign/make-site-logo-banner.shtml You should also read that tutorial if you're not sure how wide your picture should be. While there are no rules for the width or height of an image for a website, if your picture is too wide, you'll have a very difficult time getting it to fit into your web page. Again, remember this cardinal rule: pictures of any sort that you want to place your site must be in either the GIF, JPG or PNG file format. Do not use any other format.
If you want to place other types of pictures on your website, such as pictures of your products, photos of yourself and scenery, and so on, you should also get them ready before you begin the tutorial. For those of you selling software (or giving it away free) only in electronic form, you can also use a program like a 3D software box software to create an image of the box to place on your site. Free versions of such software can be found on the Free 3D Software Box Image Makers page. Images of physical software boxes tend to make your software look more valuable in the minds of visitors. Likewise, if you are selling (or giving away) electronic books and want to create images of such books, either use a drawing program to draw it manually, or get commercial software (there are no free ones that I know of) like Box Shot 3D (which can create both 3D software boxes and books) to do the job. For example, the picture here of my How to Make / Create a Website: The Beginner's A-Z Guide was created with BoxShot. Note: there is no such physical book, so please don't email me to ask where you can buy the guide. If you want to read it, the complete guide is available online (and you
13
the name in the header, you can use your left arrow keys on the keyboard to position it at the beginning.) This is the place where you will be inserting your site logo. Click "Insert | Image" from the menu. If you remember from the previous chapter, my shorthand notation "Insert | Image" means that you are to click the "Insert" menu, and then click the "Image" item in the menu that appears. A dialog box should appear. If you have been following my instructions, there should be two folders listed here, "_notes" and "images" (which you created in an earlier step). Doubleclick the "images" folder to open it. A list of images that you copied to this folder earlier should appear. If you've copied many images here, and are not sure which one is your logo, click once on each item in this dialog box to see the picture in the "Image preview" box in the right side of the dialog box. When you're satisfied that you've got the correct image, select it and click the OK button. A new dialog box, with the title "Image Tag Accessibility Attributes" will appear. Enter "Example Company's logo" into the "Alternate text" field (if "Example Company" is the name of your website). Basically this "alternate text" is just a text description of what your image is about. It is shown in the browser if your visitor goes to your site with graphics disabled. It is also read aloud by screen readers (used by the blind), and indexed by search engines as the description for that picture. Although Dreamweaver does not force you to enter anything, you should always do so anyway to make your website accessible to the disabled. Ignore the "Long description" field, and click the OK button. For better or for worse, the logo will now appear beside your site name in the header. If you find that your logo is too big (or ugly or whatever) and you want to redo it, click it once with your mouse to select it, and hit the DEL key (on your keyboard). This will remove the logo. You can then go back and recreate the logo, save it into the "images" folder, and repeat the insertion procedure again. Alternatively, if your logo is one of those that should take up the entire horizontal space of your website, and you want the name of your site underneath the logo, click your mouse between the image and the first letter of your site name. The blinking text cursor should now appear just after the logo and before the name of your site. Hit the ENTER (or RETURN) key to move the site name under the image. If the result is not to your liking, you have at least two options. If you simply want to reverse what you just did, click "Edit | Undo New Paragraph" from the menu to undo the operation. Alternatively, you can re-create the logo you made so that it includes your website's name. That way, instead of having the logo and the text version of your site name, you can completely delete the text and let the picture take its place completely. Your picture will then have both the logo and the name of your site. If you choose this route, make sure that your site name appears in the "Alternate text" of the picture (and preferably elsewhere on the page as well), otherwise when visitors search for your site by name in the search engines, your site will not be listed.
15
5. How to Fix the Spacing Between the Logo and Your Site Name
Even if your logo is small enough to fit beside your site name in the header, you will probably find that it is uncomfortably close to the name. To introduce some space between the logo and the name, click the picture once to select it. Look at the bottom of your Dreamweaver window. You should be able to see a panel with a single tab labelled "PROPERTIES". This is the Properties pane. When you click your picture to select it, the Properties pane should be populated with a variety of fields that you can configure for your image (see picture below).
Enter "5" (without the quotes) into the "H Space" field and hit the ENTER key. Notice that some space has been added to either side of your logo when you do so. If the space is either too large or too small, adjust the number you entered till you are satisfied with the results. As you may have guessed, a larger number increases the horizontal space around the image while a smaller one decreases it. You can also put a number into the "V Space" to adjust the vertical space around the image.
16
This is usually not what a web designer wants, since the placement of objects is awkward at best. To align the picture to the left of the words so that the words flow all around the words, locate the "Align" drop down box in the Properties pane. It is currently set to "Default". Click it and select "Left". Your web page should now look like this:
The image is now flushed to the left with the words flowing all around it. If you prefer that the picture appear on the right, select "Right" from the drop down menu instead of "Left". You should of course also adjust the "H Space" and "V Space" around the picture so that the words do not come right up to the edge of the picture. The above is merely an example to show you the effect of using the "align" facility in the Properties pane. When you're through with your changes, save your page and publish it again. And of course, test it by pointing a web browser at your site. Even though you're using a What You See Is What You Get (WYSIWYG) web editor, you should always check the changes you make in a real web browser instead of relying on Dreamweaver's representation of the page. (In fact, you should check it in multiple browsers.) Congratulations. Your site now looks more professional with the addition of a logo and pictures of your products.
17
How to Change Font Typefaces, Weight, Style, Colour and Sizes in Dreamweaver CS4 (Chapter 3)
by Christopher Heng, thesitewizard.com In the previous chapter of the Dreamweaver CS4 tutorial, we worked on beautifying your web page with pictures. In this part of the tutorial, we will focus on how you can modify the appearance of the text on your web page. If you have only just arrived in this tutorial series at this chapter, and are new to Dreamweaver CS4, it may be best to start with the first chapter of the tutorial: How to Create a Website with Dreamweaver CS4. This tutorial assumes that you have already completed the earlier two chapters, and thus have created a two column home page, uploaded (published) it to your site, and added a site logo and (optionally) other pictures to your page. It also assumes that you are already familiar with the techniques taught in those chapters.
Before You Begin: Things You Should Know About Fonts in Web Pages
Web pages are not like wordprocessor documents. In the latter, you can freely change the fonts of your text to whatever font you want, so long as you have that font installed on your computer. When you print the result, the font choices you made in creating the document will be reflected in the result, since most people print the document from the same computer that they created it on. On the Internet, your web page will mostly be viewed by others using their own computers, not yours. As a result, you cannot simply use some fancy font on your web page, and expect your web page to appear as you designed it when it is viewed by others on the web. They may not have the same set of fonts installed on their computers that you have. For this reason, most webmasters stick to using a standard basic subset of fonts that are found in most computers currently in use in the world. By default, since you're using Dreamweaver's 2 column "liquid" template, your page is currently displayed using one of the following typefaces: Verdana, Arial, Helvetica, sans-serif
18
This list is to be interpreted this way: if your visitor's computer has the Verdana font, the browser will use that font to display the page. Otherwise, the Arial font will be used, and failing that, the Helvetica font will be chosen. Finally, if none of the fonts listed can be found, the browser will use any sans serif font it can find on the computer. (If you don't know what "sans serif" means, please see the article Which Font Should I Use for My Web Page? Tips on Choosing Fonts for Your Website. It contains a more detailed discussion about the use of fonts in web pages.) The fonts in this sequence were chosen because they look fairly similar to each other (although they are not exactly the same). The Verdana and Arial fonts can be found on Windows and Mac OS X computers, so if you leave the fonts at their default setting, it's probably safe to assume that your page will look mostly the same in the majority of your visitors' computers. Dreamweaver allows you to select other series of fonts as well. You can see the list in the "Format | Font" menu. (That is, click the "Format" menu followed by the "Font" item in the menu that appears.) For example, the line "Courier New, Courier, monospace" means that the Courier New font is used if available. Failing that, the Courier font is used. Otherwise, the browser is to use any monospace font it can find. While Dreamweaver allows you to add other fonts to its list of fonts, using "Format | Font | Edit Font List...", it's generally not a good idea to do so. If a font is not in the list displayed in the "Format | Font" menu, it is probably not found on many computers (even if it is installed on yours). Webmasters who want their site to appear the same on (nearly) all computers often use one of the following series:
Arial, Helvetica, sans-serif Verdana, Arial, Helvetica, sans-serif Times New Roman, Times, serif Courier New, Courier, monospace
For those who are curious, at the time I write this, thesitewizard.com uses "Arial, Helvetica, sans-serif" for all its articles. If you want to know more about the use of fonts in web pages, please read the article Which Font Should I Use for My Web Page? Tips on Choosing Fonts for Your Website found at http://www.thesitewizard.com/webdesign/which-fonts-to-use.shtml
The Theory Behind Changing Fonts in Dreamweaver CS4: Introduction to Cascading Style Sheets (CSS)
Before you actually change fonts for your web page using Dreamweaver, it's helpful to understand a bit of how Dreamweaver works for such operations. Dreamweaver uses a technology known as Cascading Style Sheets, or "CSS" for short, to accomplish things that affect the appearance of your web page. For the most part, it does this
19
behind the scenes for you, so you don't actually have to know anything about CSS, HTML, or what-have-you. However, since CSS affects a lot of what you do when you want to change the appearance of your page, you can work more confidently and efficiently if you have at least a small bit of knowledge of how it works. Let's say you want to change every instance of the words "Example Company" on your web page so that it appears in the Times New Roman font. In prehistoric days, before CSS was invented, you would have to go through your web page and add a Times New Roman font instruction into the web page just before each instance of "Example Company". If you were to change your mind later, and decide that you preferred, say, Comic Sans, you would have to go through the whole web page again, and everywhere where "Times New Roman" appeared, you would have to replace with "Comic Sans". And since it's unlikely that you only have a single web page on your site, you would have to repeat the procedure with all the other pages as well. With CSS, it's possible to avoid this tedious procedure. CSS allows you to label all instances of "Example Company" with a descriptive name. For example, I may want to attach a label of "mycompanyname" to every instance of "Example Company" on my website. Then I associate a "Times New Roman" font instruction with the label "mycompanyname" in a single place on my site, in what is known as the style sheet. With that single instruction, every part of my website that has the label "mycompanyname" will instantly be displayed in the Times New Roman font. If I change my mind later, all I need to do is to replace the "Times New Roman" instruction in my style sheet with the new font that I want. And all my web pages will automatically reflect that change. As such, in order to change fonts for your web page later, we will be attaching labels to the pieces of text that you want to modify the font for. These labels are called "classes" in webmaster jargon.
20
The defaults set in the "New CSS Rule" dialog box will be different depending on what you've selected. If you have selected only a few words within a paragraph, the "Selector Type" drop down box will probably show "Class (can apply to any HTML element)" and the "Selector Name" field will be blank. If you have selected one or more paragraphs, the "Selector Type" drop down box will display "Compound (based on your selection)" and have a "Selector Name" pre-filled with some value such as ".twoColLiqLtHdr #container #mainContent p" or the like. No matter what was preselected for you, click the "Selector Type" drop down box and choose the "Class (can apply to any HTML element)" item. When you do this, the "Selector Name" field should immediately be emptied (if it had content previously). Now click the empty box under "Selector Name". You will need to enter a class name in this box to describe the block of text. This is the "class" or label that I mentioned above in my theory behind font changing in Dreamweaver section. (If you dozed off when you read that section, you may want to revisit it so that you know why we're doing this.) The class should begin with a letter of the alphabet. It can contain letters and numbers but must NOT include any spaces or punctuation marks. For example, "mainbody" and "productfeatures" are acceptable names for classes, but "main body" and "product features" are not. Don't spend too long trying to figure out a class name: it's just a descriptive label for you to use for font changes and the like. It will not be displayed in the visible portion of your web page so you don't have to worry about coming up with a fancy name. (If you're really stuck and can't think of a name, use "mainbody" [without the quotes] if you're selecting practically every paragraph in your main content section. Like I said, it's just a label. It'll be nice if your label is descriptive of what you're selecting, but don't kill yourself over it.) As you type your class name, the description box underneath will probably tell you something like "This selector name will apply your rule to all HTML elements with the class '...'" (where the ellipsis "..." will be replaced with whatever name you have actually used). When you've finished with the name, look for the "Rule Definition" box at the bottom of the dialog box. Click the drop down box and select "twoColLiqLtHdr.css". Click the "OK" button. Your new font selection will be added to the default style sheet created by Dreamweaver when you first made your site.
21
Let's say that you want to change all the product description paragraphs in your web page to have a certain font. The first time you do this, follow the procedure given above and label your class "productdescription" or whatever. Later, when you add a new product to your page, and want its text to have the same font, simply select the text in question. Then look at the PROPERTIES pane at the bottom of the Dreamweaver window. (See picture below.)
You should be able to see a "Class" field in that panel. (If you don't see a "Class" field, click the "HTML" button in that same panel.) Click the down arrow beside the "Class" field. Scroll up or down that field to find the "productdescription" name or whatever class name that you assigned earlier. Click it. The new product description paragraph will immediately be displayed in the font you selected earlier. If however, you are adding an unrelated paragraph to your web page, say an "Awards Won" section, and want a different font, you will have to use the "Format | Font" menu all over again, and give that paragraph a different class name.
"font-family" or the actual font name itself. A dialog box, "CSS Rule Definition for ... in twoColLiqHdr.css", will appear, where the ellipsis, "...", is replaced with the name of the class you set earlier. If the name of the class is not the right one, it means that you have either doubleclicked the wrong item, or your cursor is located in the wrong part of your web page. Dismiss the dialog box by clicking the Cancel button and try again. In the dialog box, click the down arrow for the combo-box for "font-family" and select the new font that you want. When you're satisfied, click the OK button. You should be able to see the changed font on your web page immediately. If you have many separate pieces of text on your web page using the same class, all of them should reflect the changed font. Incidentally, if you want to collapse the CSS STYLES panel and expand the FILES panel, just doubleclick on the FILES panel tab. The latter will expand and the CSS STYLES panel will again be reduced to just the tab. (Once again, the exact sizes of the panel may differ depending on your screen resolution. I'm currently using Dreamweaver on a low resolution monitor, so expanding one panel collapses the other.)
You should be able to see a "Size" field in the panel. By default, it should be set to 100%. Enter your preferred size into that field. If you prefer to work in some other unit other than percentage, click the down arrow for the "%" (percent) box and select the unit you want. In general, for web pages, it's best to work in either percent ("%") or ems ("em"). Units like points ("pt") work better for the print medium than for the computer monitor. When you hit the ENTER key (or the RETURN key if you're using a Mac), the "New CSS Rule" dialog box appears. Do the same as you did earlier when changing the font and assign your size change a class name. Although it may seem tedious now, this
23
method has long term benefits if you're going to be using the same size for different pieces of text and modifying it at some future date. The same things that apply to the typefaces mentioned above apply also to font sizes. That is, you can select other pieces of text for which you want the same font size, go to the PROPERTIES panel, click the "HTML" button.
Click the class drop down box to select the same class you just created.
24
If you are changing the colour of a piece of text for which you have already applied some sort of style (like changed the font above), use the CSS STYLES panel to invoke the CSS Rule Definition dialog box as before, and change the colour from there. (See above section.) However, if the piece of text does not have any custom font face or size changes, select the text, click the "CSS" button in the PROPERTIES panel at the bottom of Dreamweaver, and click the black square box near the "Size" field (to its right).
A colour picker window will appear, allowing you to select a colour simply by clicking on it. Clicking it, however, will open the "New CSS Rule" dialog box that you've met earlier when you changed the font and its size. By now you should be quite familiar with this dialog box and should know what to do. That is, set a name for your class after making sure that the selector type is set to "Class (can apply to any HTML element)", and ensuring that the Rule Definition is saved in the twoColLiqLtHdr.css file.
If you are using Windows, and are familiar with using the usual wordprocessor shortcuts of Ctrl+B for bold and Ctrl+I for italics, the same keyboard shortcuts will also work here. If you don't know what I'm talking about here, just stick to the method given in the paragraph above.
25
Publish the web page the same way you did in the previous two chapters. And remember, as before, to allow Dreamweaver to upload "dependent files". Then check out your new home page in your web browser. Congratulations! Your home page now has text that is approriately customized for your purpose. In the next chapter, you will learn how to change the background of your web page. This includes setting the background colour of each column of your page (if you wish) and also, optionally, adding a background image to your content
2. Change the background colour of selected portions of your web page, like the side bar, the main content section, the header and the footer. 3. Add a background image as the backdrop to your web page, or selected section of your web page. This chapter also introduces the Dreamweaver status bar, a useful tool that allows you to select different elements on your web page for customization.
Make Sure That Your Background Image Does Not Interfere with Your Foreground Text
If you're adding a background image, make sure that the image is such that it does not make it difficult for visitors to read your page. This may seem obvious to you, but since I've encountered a few beginning websites with this problem, I thought I should at least mention it.
The basic principle is that background colours and images are merely the backdrop to your main content. Change them all you want to make your site pleasing to the eye, but don't let them detract from the content itself. Your site's visitors are not there to gawk at your background colours or image. They are there to buy your products or read your content.
How to Change the Background Colour or Add a Background Image in Dreamweaver CS4
If you've not already done so, start up Dreamweaver CS4 and doubleclick the "index.html" file in the FILES pane. Your web page at this point should have the two column layout that we created in chapter 1, a site logo and possibly other graphics that we added in chapter 2 and any customized font settings that you made in chapter 3. If you were to look at the background colours of your web page as it currently stands, you will see that it basically has a few sets of colours.
The header, footer and side bar has different shades of light grey. The main content section has a white background. The background behind the two columns, header and footer has a dark shade of grey. I shall refer to this as the "page background", since this is actually just the default background colour of your entire page as set by Dreamweaver's two column template.
27
In the PROPERTIES panel at the bottom of the Dreamweaver window, you should be able to see a button that says "Page Properties". Click it. A dialog box entitled "Page Properties" will appear. Do either one of the following (depending on whether you want to change the background colour or set a background image).
pattern and click "Apply" again. When you're satisfied with your choice, click the "OK" button. (Note: if you change your mind about using a background image, and have clicked the "Apply" button earlier, clicking the "Cancel" button will not undo your change. To undo it, click the "Background image" field and use the DEL or backspace key to remove the filename and folder. That is, empty that field. You can leave the "Repeat" field as it is.)
In spite of its innocuous appearance, the status bar is important in Dreamweaver if you want to customize your website's appearance. It allows you to select entire blocks in your web page so that you can change things like colours, fonts, etc, of whole sections of your page in one go. Notice that the left side of the status bar contains apparently gibberish text, enclosed in angle brackets, such as "<div#container> <div#sidebar1> <p>". Again, the exact words appearing here may be different depending on where you clicked on your page and how big your Dreamweaver window is. For ease of reference, I shall refer to these words enclosed in angle brackets as "tags" from this point forward. For example, "<p>" is one tag, "<div#sidebar1>" is another tag and "<div#container>" is yet another tag. Contrary to what you may think, each of these tags in the status bar is actually a clickable button. Clicking each tag will select a different block enclosing the spot where your text cursor is in. Try it. For example, if the left side of your status bar looks exactly like mine, click the "<p>" tag. Notice how the entire paragraph is selected when you do this. This is because "<p>" refers to a "paragraph" in the underlying code of your web page. (This underlying code, by the way, is called "HTML" in webmaster jargon.) Observe also that the "<p>" tag on the status bar is now enclosed in a white box to show that it's currently selected (because you clicked it).
29
Now click the "<div#sidebar1>" tag. This time, notice how the entire left column is selected. Finally, click the "<div#container>" tag. Both the columns, the header and the footer should now be selected. Each of these tags indicates a block of items on the screen. The "<p>" block is designed to hold a single paragraph of text, hence its name. This paragraph block lives in a bigger block, the side bar block. The side bar block, however, does not use a "<p>" tag, since a "<p>" tag is only used for a paragraph of text. Your side bar can contain words, pictures, lists of items, and so on. As such, a different tag is needed, namely a "<div>" tag. The block managed by a "<div>" tag is often called a DIV block (naturally). And as you found out, this side bar DIV block is itself enclosed in an even bigger DIV block that Dreamweaver uses to contain all the columns, header and footer on your page. To reinforce what I've just said, put your text cursor in a different section of your page, such as the header (the top horizontal bar where you placed the name of your website in chapter one). Once again click the different tags. Notice that your company name itself is enclosed in a different type of tag, the "<h1>" tag. This is in turn enclosed inside a DIV block ("<div#header>" this time). And as all things on your Dreamweaver web page is, this is enclosed in an even larger DIV block. Feel free to put your cursor into different parts of your page, click the different tags on the status bar, and see which sections are selected. Don't worry. You don't have to memorize anything you see. The main point of this exercise is to provide you with some background so that you'll have a greater understanding of what you will be doing later in the practical "howto" section. (Okay, it's true. I'm also underhandedly sneaking in a bit of HTML knowledge, namely the tags and DIV blocks. Although Dreamweaver lets you design a website completely without knowing anything about things like HTML or CSS, a little knowledge tends to go a long way to help you understand why things work in a certain manner. Otherwise web design will end up being like voodoo.)
Changing the Background of the Header, Footer, Side Bar and the Right Column (Main Content)
Now that you have figured out the status bar, and how to select an entire column or section, we will be able to configure the background of that section.
To change the background of the header, click the <div#header> word in the status bar. To customize the background of the left column, or side bar, click the <div#sidebar1> word in the status bar.
30
To configure the background of the right column, or main content section, click the <div#mainContent> word in the status bar.
Or, to put it another way, since you now know the technical lingo, select the DIV block that you want to customize.
Procedure for the Header, Footer and Side Bar (Left Column)
The procedure for changing the background for the header, footer and side bar, but NOT the right column/main content section, is identical. Open the CSS STYLES pane on the right side of Dreamweaver. (See the previous chapter if you've forgotten how to do so.) Double-click the "background" item in the CSS STYLES panel. (You may have to scroll down the box to find it.) The "CSS Rule Definition" dialog box that you met in the last chapter will appear. You should now see the "Background-color", "Background-image" and "Backgroundrepeat" lines that you met in the Page Properties dialog box in the section above. (The dialog box is not exactly the same, but those fields work the same way.) Configure them as you wish. If you have skipped that section previously because you didn't want to change the page background, go back and read just the parts "To Change the Background Colour" and "To Use a Background Image".
which button it is, move your mouse over each button (without clicking) and wait until a tooltip for that button appears. Click the button that has a tooltip of "Browse". The "Select Image Source" dialog box will appear, allowing you to choose the image for the background. To control whether that background image is repeated (as you did earlier), click the "Add property" link again and select the "background-repeat" item from the drop down box. Then click the down arrow to open the list of your options and select the appropriate one. (Note: if you don't know what this "repeat" thing means, it means you skipped the section above. Please revisit that section for more information.)
How to Make Pictures and Text into Clickable Links using Dreamweaver CS4 (Chapter 5)
by Christopher Heng, thesitewizard.com Links, also known as "hyperlinks" in some quarters, are arguably one of the fundamental essentials in a web page. They allow you to point your visitors to another page on your site, as well as to other websites on the Internet. Without links, the World Wide Web would not be that inter-connected web of documents that it is today. This chapter of the Dreamweaver CS4 Tutorial series takes you through the process of creating links on your website as well as making existing pictures and words into clickable links. Note: if you are new to Dreamweaver CS4 as well as this tutorial series, I recommend that you start at the first chapter How to Create a Website with Dreamweaver CS4. This article assumes that you have completed the previous 4 chapters, and have published a website that has much of the main page already completed.
32
made your logo into a clickable link that leads to your main page; learnt how to make any image into a clickable link; learnt the basic principles behind a photo gallery or image gallery website; and created one or more text links to other pages on your website.
How to Make Your Logo into a Clickable Link to Your Home Page
33
If you look at thesitewizard.com's logo on the top left corner of this page, and hover your mouse cursor over it, you will notice that it is actually a clickable link pointing to my home page. Although nobody has dictated that all site logos be clickable links to the home page, so many websites have done this that it is practically a convention today. As such, it is good that your site also support this feature, since users have come to expect that they can quickly get to a website's home page by clicking the logo. Following the established convention of the majority of websites allow you to create a more usable website without much effort, since your visitors will automatically know how to move around and use your site efficiently. 1. Start up Dreamweaver and load your "index.html" page. 2. Click your site's logo on the page. This will select it and load the PROPERTIES panel at the bottom of the Dreamweaver window with the image properties.
3. Look at the "Link" field in that panel. This is where you will enter the URL to your home page. If your website has an address like "http://www.example.com/", enter "http://www.example.com/" (without the quotation marks) into that field. Alternatively, it's also possible to enter a relative URL like "index.html" (without the quotes) there as well. If you can't decide whether to use the absolute URL for your website ("http://www.example.com/") or just a relative URL ("index.html"), I suggest that you put the full URL to your domain here (for reasons mentioned in another article "Should Your URLs Point to the Directory or the Index Page?"). 4. Enter "0" (zero, without the quotes) into the "Border" field in the PROPERTIES panel. If you don't do this, certain browsers may show the image with a blue border to indicate that the image is a clickable link. The border attribute of "0" makes the border have a size of zero, effectively removing it. 5. Save your page and publish it. Check out your web page with a browser, and you will find that your mouse cursor changes to a pointing finger when you hover it over your logo, indicating that it's a link. Clicking it, however, won't do you much good since you're already at your home page. (Or rather, clicking it will cause your home page to load. Since you're already at your home page, you won't notice anything different.)
you'll just get a "404 File Not Found" error in your browser. That's normal. When you create the "order.html" later and upload the page, the error will disappear.)
How to Make Clickable Images that When Clicked Opens Up a Larger Image
I'm sure you've seen those photo galleries on the Internet that present you a thumbnail picture (small version of an image), that when clicked, loads a larger image in your web browser. You now have sufficient technical knowledge, where Dreamweaver is concerned, to accomplish that. The trick here is to have two versions of the picture: a small (thumbnail) and large version. The large version is your original photo in its full glory. To get the thumbnail version, simply use a photo or image editor to resize the original image to smaller dimensions, and save it under a separate filename, so that you now have two files: the original, unchanged large photo and the small resized image. Using a photo editor to accomplish this is outside the scope of this Dreamweaver CS4 tutorial (although I wrote about the procedure in another guide). Once you have both versions, do the following:
1. Copy both files into your images folder as you did in chapter 2. Don't miss this step or
Dreamweaver will not upload the pictures to your site. 2. Insert your small thumbnail version of the image into your existing web page (see chapter 2 if you've forgotten how to). 3. Click the picture, and locate the "Link" field in the PROPERTIES panel below. Click the "Browse for File" button (which looks like a folder icon) beside the field. A dialog box appears. Double-click the images folder and locate the bigger image. Select it and click the "OK" button. Dreamweaver CS4 will insert a relative URL to the image into your "Link" field. Notice that this relative URL is of the form "images/your-big-file-name.jpg" where "your-big-file-name.jpg" is the name of your large file. In particular, note that the slash separating the "images" folder and the filename is a forward slash "/". Domains, folders and filenames are always separated by forward slashes ("/") on web pages, even if you are using Windows (where the convention is the backslash character "\").
35
Alternatively, if yours is a personal website you may want a link on your main page to a "hobbies.html" page. At worst, if at this point in time, you have absolutely no idea what other pages of your site you want to link to, look at the footer of your page. If you have put a copyright notice in the footer as was suggested in chapter 1, you probably have some text saying "Copyright 2008 by Christopher Heng" or the like. Of course the year may be different for your page (depending on when you're creating this site), and instead of "Christopher Heng" you will have either your company name or your own name. Whatever the case may be, you can make the name portion into a clickable link pointing to "feedback.html" (a practice used by a number of sites). We will be creating this "feedback.html" file in the final chapter of this tutorial, so this is generally a safe link to create if you don't really know what else to do. Once you've decided what you want to make into a clickable link, do the following: 1. Select the word or words that you want to make into a link. 2. In the PROPERTIES panel at the bottom of the Dreamweaver window, click the "HTML" button if it has not already been clicked. The panel should now show a "Link" field. Enter the address that you want to link to. For example, if you want to link to your feedback form, enter "feedback.html" (without the quotation marks). If you want to link to some other website like thesitewizard.com, enter an absolute URL for that site, like "http://www.thesitewizard.com/" (again without the quotation marks). The former is a relative link, pointing to a file on your page, while the latter is an absolute link, pointing to a page on another website. Notice that the relative link does not have the "http://" prefix while the latter does. Incidentally, if you're linking to "feedback.html", make sure that you type the name exactly as I gave it, without changing anything to capital letters or adding spaces. As mentioned earlier, we will be creating "feedback.html" in the last chapter, and if you modify the name, your link will not point to the correct page. If you are linking to other pages on your website, you may also want to take a look at the article How to Create Good Filenames for Your Web Pages. 3. Hit the ENTER key when you've finished entering the link. The word or words you highlighted will now appear as an underlined clickable link. Save, publish and test your web page as before.
Next Chapter
So far, you have been modifying the main content, header and footer blocks on your web page. In the next chapter, we will customize your side bar (left column) to include a navigation menu. The navigation menu will contain clickable buttons that are actually just text links in disguise, somewhat similar to what you see on left column of thesitewizard.com.
36
You will have added a navigation menu bar with buttons that, when clicked, will take your visitors to other pages on your website. Like thesitewizard.com's navigation menu in the left column, the buttons on your site's navigation menu will also change colour when the mouse hovers over them. You will have finished designing the home page of your website. As a result, if you are still currently using placeholder text on your web page, you should take this opportunity to replace it with the real content of your site.
Website Structure
Before we go on to actually adding a navigation menu to your site, it is necessary to discuss the other pages that you want to create for your site (else you'll have nothing to link to in the navigation menu). While there are no fixed rules to the sort of pages you must have for your website, in general, many websites have the following pages (in addition to the home page):
Site Map
For websites with multiple pages, it's usually a good idea to create what is known as a "Site Map". A site map is meant to be an exhaustive (or perhaps near-exhaustive) list of all the web pages on your site. Visitors who are looking for a specific page and cannot find it using the normal links on your other pages can use the Site Map to locate the page they want. If you have a large number of pages on your website, you
37
may even want to separate the different pages on your site into categories in your site map, like what you see in thesitewizard.com's site map. You will be creating a site map later in the next chapter.
About Us
Some websites, particularly company websites, have an "About Us" that give some information about the people (or company) behind the website. For personal websites, some webmasters place their resume, or curriculum vitae, here, presumably to attract prospective employers.
Price Lists
If a site is selling a product or a service, a page listing the prices of various products is very important. See the article Is Your Website Design Driving Away Your Customers? Some Basic Usability Tips for Commercial Websites for more details if you're selling things on your site.
Links
Some sites have a "Links" page, where they place links to other sites that they have found useful or relevant.
Privacy Policy
If you are collecting information from your visitors, such as you will if you put up an order form, you'll probably want to have a page telling your users what you will or will not do with their data. Personally, I doubt anyone actually reads such a page, but it may be a good idea to reassure your customers that you will not leak their credit card numbers and whatnot to the unwashed masses.
Although you will undoubtedly have many other pages on your website, it is probably not possible to link to all of them in your navigation menu. Doing so may result in a very cluttered and hard-to-read side bar that is longer than the main content column. To avoid such an unsightly navigation bar (or "navbar" as it is sometimes called), many webmasters only place links to pages such as listed above in the menu. For the purpose of this tutorial series, you will be creating (in addition to the home page, which you will complete in this chapter) the feedback form page, the "Site Map" page, and optionally, the "About Us" page. The pages will have the following names:
38
Feedback Form
Name of page: "Feedback Form" Filename: "feedback.html"
Site Map
Name of page: "Site Map" Filename: "sitemap.html"
About Us (Optional)
Name of page: "About Us" Filename: "aboutus.html"
If you have other pages that you want to link to in your navigation menu (such as those I mentioned above), feel free to add to this list. In forming the filenames for those other pages, please note the rules I wrote in How to Create Good Filenames for Your Web Pages, that is, do not uses spaces in your filenames and stick to small letters (lowercase). And end all your filenames in ".html".
method to getting rid of both the "sidebar1 Content" subtitle and the placeholder text in the side bar. While you're right in that it will get rid of both items, it will also delete your entire side bar. If this warning came too late for you, you can undo your accidental delete with "Edit | Undo Delete" (that is, click the "Undo Delete" item from the "Edit" menu). 3. Click "Insert | Spry | Spry Menu Bar" from the menu. That is, click the "Insert" menu, followed by the "Spry" item in the menu that appears, and then the "Spry Menu Bar" item in the submenu that appears. 4. A dialog box, entitled "Spry Menu Bar", will appear. Since you're creating a menu bar for your side column, and want the menu items to appear one after the other vertically, select the "Vertical" item and click "OK". 5. Dreamweaver CS4 inserts a default menu bar into your site column with some dummy content. The menu has four items. Items 2 and 4 are normal menu items, while items 1 and 3 have sub-menus: notice that there is a small right arrow on the buttons for items 1 and 3. In an actual browser, hovering your mouse over item 1 and 3 will expand the submenus. (It won't expand in Dreamweaver, since the latter is an editor, not a real browser.) Look at the PROPERTIES panel at the bottom of your Dreamweaver window (pictured below).
Notice that there are 3 list boxes in the middle of the panel. The first list box contains "Item 1", "Item 2", "Item 3" and "Item 4". Theses are the 4 buttons that you see in your web page. At present, "Item 1" is selected. Since "Item 1" is a button with submenus, the second listbox is populated with the items in the submenu, namely, "Item 1.1", "Item 1.2" and "Item 1.3". If you were to click on "Item 2" in the first list box, you'll notice that the second listbox becomes empty. This is because the menu button "Item 2" does not have a submenu. Now click "Item 3". The 2nd listbox is filled with that button's submenus. Click "Item 3.1" in the 2nd listbox. Notice that the 3rd listbox is now filled with two items "Item 3.1.1" and "Item 3.1.2". In your main Dreamweaver window, you should be able to see that Dreamweaver has expanded the button menu to show the first level submenu so that you have an idea of how your menus appear visually on your web page. Essentially, Dreamweaver lets you configure a menu system up to 3 levels deep, should you need them. In this tutorial, you'll only be using a one-level menu system. That is, the menu will behave like the one you see on the left column of thesitewizard.com, where clicking any button will lead you to another web page on the site, with no submenus appearing. If your site is complicated, you can of course use a multi-tiered menu system if you wish.
40
Usability note: in general, if you don't really need a multi-tiered menu system, don't use it. Multi-tiered menu systems tend to have a greater number of browser usability issues (and probably also acessibility issues) than a simple button menu. For example, if you're an avid web surfer, I'm sure you've encountered sites where you tried to invoke a submenu item on such a menu only to find that the menu closes on you before you can click the item. Multi-level menu implementations on the web still have a long way to go before they can catch up with the multi-tiered menu system you're used to in an operating system like Windows, Mac OS X, or Linux. The second and third level submenus also don't work if your visitors disable JavaScript in their browser. 6. Click "Item 1" in the first list box in the PROPERTIES panel. The first item in a navigation bar is typically the link to the website's home page. Since we will not be needing submenus for this button, we will delete them. To do this, click "Item 1.1" in the second list box. Notice that directly above "Item 1.1", the "-" (minus) sign, beside the existing "+" (plus) sign, is now shown in bold. As you may have guessed, clicking the minus ("-") sign will delete the item you've highlighted, while clicking the plus ("+") sign will add a new one. Click the minus sign now. "Item 1.1" should immediately disappear, leaving you with "Item 1.2" and "Item 1.3". Do the same and remove items 1.2 and 1.3. You should now have two empty listboxes next to the still-populated first one. 7. To the right of the 3 list boxes, you should be able to see a few fields. The "Text" field contains the words that you want displayed on the button. It should currently say "Item 1". Change it to "Home" (without the quotation marks). Click the "Link" field, which currently contains a hash ("#") mark. Notice in the window above, that your menu bar now shows "Home" for its topmost button. Put the address of your website's main page in this "Link" field. It's best to use the same URL as the one you used to make your site logo into a clickable link in chapter 5. That is, if you used an absolute URL like "http://www.example.com/" for your site logo link, use the same thing here. If you used a relative URL like "index.html" for that link, put "index.html" (without the quotes) here. While both links point to the same page, the consistency will help you minimize (or even avoid) the content duplication problems mentioned in the article How to Create a Search Engine Friendly Website. 8. Click "Item 2" in the leftmost list box. Change the "Text" field, currently showing "Item 2", to "Feedback Form" (without the quotation marks). Or you can call it "Feedback", "Contact Us", "Contact Form", "Support" or some other words if you like. Don't waste too much time figuring out which set of words is better. No one except you will even bother about which words you use, as long as the meaning is clear. I'm not even consistent about this across different websites myself: for example, thesitewizard.com uses "Contact Us" for that button while thefreecountry.com uses "Feedback".
41
In the "Link" field, replace the hash ("#") mark with "feedback.html" (without the quotes). Do not use any other filename. We will be creating this page in the last chapter, and if you change the filename, your links won't work correctly. 9. Click "Item 3". Click "Item 3.1" and then the minus ("-") sign above. A dialog box saying "This menu and all its children will be deleted. Would you like to proceed?" will appear. This is because you are not just deleting a single menu item ("Item 3.1"), but also removing all its submenus ("Item 3.1.1" and "Item 3.1.2"). Dreamweaver wants to make sure you know what you're doing. Click "OK". Remove "Item 3.2" and "Item 3.3" in the same way (by clicking the minus sign). There should be no warnings for these since they don't have lower-level submenus. Replace the "Item 3" words in the "Text" field with "About Us", and the "#" in the "Link" field with "aboutus.html". Note: as I mentioned above, this "About Us" page is optional. If you don't want such a page, and don't wish to replace that link with another (eg to your "Buy Now" or "Price List" or whatever), delete the item by clicking the minus ("-") sign over the leftmost listbox. Make sure that "Item 3" is highlighted in that list box before clicking the minus sign or you may end up deleting the wrong menu item. 10. Replace "Item 4" with "Site Map" and make it point to "sitemap.html". 11. Depending on how you set the background colours of your side bar in chapter 4, you may find that the background colour of your left column ends midway in the window, compared to the right column. That is, it doesn't go down all the way to the footer. One way of dealing with this is to add blank lines after your menu bar (just click the blank space below the menu and keep hitting the ENTER key). Another way is to do what I did on thesitewizard.com: make the left column have the same background colour as the main content area. 12. Click "File | Save". A dialog box called "Copy Dependent Files" will appear, asking you for permission to copy the files needed by the Spry navigation menu to your website folder. Click "OK". Dreamweaver will then create a new folder ("SpryAssets") in your website's directory that contains the support code for the menu. Although your menu is fully functional and complete at this point, do not publish your page yet. There are still a few customizations that you may want to do.
How to Add New Items to Your Existing Spry Menu Bar Widget
If you have a change of heart (whether now, or some time in the future) and decide to add new items to your menu, click any of the existing items in your first listbox. Then click the plus ("+") button. A new menu item will appear immediately below the one you highlighted. You can change the text and link as before. If the menu item is in the wrong spot in your menu, and you want to change the order, click the up or down arrow above that list box.
42
The up and down arrows are just next to the plus and minus buttons, above the listbox. Clicking the up arrow moves the currently highlighted menu item up, unless the item is already at the top. Similarly, clicking the down arrow moves the item down.
44
column). It's not actually the same line, but it's in the same section of the CSS STYLES window. Directly underneath should be two additional lines, labelled "background-color" and "color". If you can't see these lines, drag the separator line above the 'Properties for "ul.MenuBarVertical a"' words upwards to make space for them. As you may have guessed, "background-color" sets the colour of the menu bar button background, while "color" sets the text colour. To change them, click the square colour box beside the item. Even though the square colour box does not look exactly like our other square colour boxes, clicking it will still display the colour picker tool that lets you change the colour of your menu items. 4. Switch back to your web page. To do this, click "Window | index.html". Do NOT click the "X" button on the "SpryMenuBarVertical.css" tab at the top of the window to switch. You still haven't saved your work, so clicking the "X" button, the close button, will cause you to lose all the customizations that you've made so far. 5. Your menu should now take on whatever new colours you have selected previously. If you don't like them and want to choose another colour, click "Window | SpryMenuBarVertical.css" again to switch back to the CSS file. If you have not moved your cursor or anything like that you should be able to change the colour as before from the CSS STYLES pane. Note: when you change the colour this time, you may find that Dreamweaver CS4 does not visually reflect this second colour change when you switch back to "index.html". This is just a display bug in Dreamweaver (which may have been fixed by the time you read this, since Dreamweaver has a built-in updater facility). If you experience this, and want to force Dreamweaver to display the latest colour change you made, click "File | Save All" to save all your changes, then "File | Close All" to close all open documents, and doubleclick your "index.html" file in the FILES pane to open it again. Dreamweaver CS4 will now display your document with the correct colours. Note that contrary to expectation, clicking "View | Refresh Design View" does not fix the problem, at least not in the version of CS4 that I have. You'll have to save, close and reopen your document.
"404 File Not Found" errors (or a message to that effect). That's okay and perfectly normal for now, since we haven't got around to creating the other pages on your site yet. Even if you don't want to click anything, you should still try moving your mouse over each menu item to test the colour changes and the like. If everything works, congratulations. You have successfully added a professional-looking menu bar to your website. Actually, your accomplishment at the end of this chapter is more significant than that:
You have also completed the home page of your website. You have mastered nearly all the skills and tricks of using Dreamweaver commonly needed by webmasters for designing ordinary web pages, so that you can actually design new pages as and when you want. There are still a couple of things left to learn (like managing multiple pages and adding a feedback form), but where making a typical, normal web page is concerned, you already have the necessary tools under your belt.
How to Use Dreamweaver CS4's Templates to Manage and Auto-Update Multiple Pages on Your Website
by Christopher Heng, thesitewizard.com Dreamweaver CS4's template system not only allows the web designer to create multiple pages on your website using the same basic design, but it is also provides the webmaster an easy way to manage and update a multi-page site. Whenever you modify the design of your template, whether to add new things, remove elements or modify the page in other ways, the web editor will automatically, with your permission, update all the pages on your site to that new design. This makes the arduous task of changing the design of a site extremely simple, since Dreamweaver does all the tedious work. This chapter deals with how you can use that template system to manage your site.
You will have created a template for your site based on the design that you've been working on so far in this Dreamweaver CS4 Tutorial series. You will have created a website with multiple pages, including the Home page (which you created in the previous chapters), the Site Map and the About Us page. All your pages will be linked to each other through the navigation menu bar that you inserted in chapter 6.
46
Note that if you have not been following this tutorial series, you may find this chapter a bit bewildering, since the information and skills presented here are built upon things taught in the earlier parts. If you're new to Dreamweaver CS4, you may find it easier to start with the first chapter.
47
When I refer to, say, the "Header" item later, simply look at the picture above and find the equivalent item on your web page. The same goes to the other items on the page, like the "Main Content" item, the paragraph under the "Main Content", the subtitle "Subheading", etc. 1. Start up Dreamweaver CS4. Doubleclick the "index.html" file in the FILES panel to open it. 2. Click "File | Save As Template..." from the menu. This opens up the "Save As Template" dialog box. Click the "Save" button. When a message box appears, with the message "Update Links?", click "Yes". Dreamweaver then proceeds to create a "Templates" folder in your website's directory. If you look at the tab at the top of the Dreamweaver window, you will see that it has changed from "index.html" to "index.dwt". As of this moment, we will be modifying the template file, index.dwt, instead of your home page, index.html. 3. The template file that you're looking at has, by default, no editable regions. That is to say, if you create a new web page using this template as it stands, Dreamweaver won't let you change any part of the new web page, since it regards the entire page as part of the fixed design for your website. What we need to do now is to tell Dreamweaver which portion of the page is editable. 4. Select the equivalent of the bold "Main Content" words (see picture above) on your web page. We want to make this title portion modifiable so that in the subpages on your website, you can replace it with the title of that page. Click "Insert | Template Objects | Editable Region" from the menu. A dialog box, called "New Editable Region", will appear. The "Name" field will be pre-filled with some default name like "EditRegion3" or the like. Delete the default name and type "Page Title" instead. Click OK. Notice that the "Main Content" words now have a caption "Page Title" above it. 5. Select all the paragraphs under the "Main Content" title If you have one or more "Subheading" subtitles and paragraphs below that, include them in your selection as well. We will mark this entire region as editable, so that you can change the content for your other pages (unless you want all the pages on your site to say exactly the same thing).
48
With that entire region selected, click "Insert | Template Objects | Editable Region" from the menu again. When prompted for the name of this region, type "Page Content", and click "OK". The section should now have a caption "Page Content". 6. There are only 3 sections left on your web page that are currently not marked as editable. The "Header", which should contain your website's name and logo, the side navigation menu bar and your "Footer", which probably currently contain your copyright notice. You will probably not want to mark the "Header" portion as editable, since your site name will be the same no matter which page on your site your visitor happens to be on. Likewise, the navigation menu bar in your side panel should probably also be the same throughout your website. If your footer contains a copyright notice like "Copyright 2009 Christopher Heng", you may want to select the year portion of the copyright notice and make it editable, since there is a chance that you may still want to add new pages next year or on some future date. To do this, just select the year portion (for example, select "2009" if that is the year you typed before), click "Insert | Template Objects | Editable Region" from the menu, and enter something like "Copyright Year" into the "Name" field. 7. Save the template by clicking "File | Save" from the menu. You will probably get a verbose dialog box popping up, informing you that putting an editable region (like the "Page Title"), inside a block tag will prevent users from creating new blocks in the region. Click "OK". If you have heavily customized your web page, so that you have even more sections that I did not mention above, you can make those sections editable using the same method described above. Give each section a different name, but make it descriptive of what it contains. The name is not displayed in your "live" website, but is shown in Dreamweaver CS4 when you edit your site, so the more descriptive the name is, the more help it will be to you when you maintain your site.
49
2. Click "File | New". The dialog box that you saw when you first created your website in Chapter 1 appears. This time, however, look for the item "Page from Template" in the leftmost column, and click it. You should now see the name of your site in the second column, the "Site" column, and the template you made previously in the third column ("index"). A preview picture of your template appears in the window on the right. 3. Make sure that there is a tick in the checkbox "Update page when template changes" in the rightmost column. Then click the "Create" button. 4. A new unnamed web page, based on your template this time, will appear. This page should be identical to your index.html file, since you did not make any changes to your index.html when you created the template. (All you did was to mark certain parts of the page as "editable".) Click "File | Save As..." from the menu. In the "Save As" dialog box that appears, click the "index.html" file, followed by the "Save" button. Dreamweaver will issue a warning that the file already exists, and asks you whether you want to overwrite the file. Click "Yes". With this step, you have replaced your old "index.html" with a new "index.html" created from your template. As far as your visitors are concerned, your home page will not look any different in a web browser. However, internally, Dreamweaver will have inserted certain invisible markers so that it will be able to update the page whenever you make a design change in your template.
How to Make a New Page from Your Own Template in Dreamweaver CS4
We will now proceed to create another 2 pages for your website: the "Site Map" and the "About Us" page. If you're not sure what these pages are for, please return to chapter 6, How to Add a Navigation Menu Bar to Your Website in Dreamweaver CS4, to learn more about these pages. Unlike the creation of your Home Page in chapters 1 to 6, however, making these 2 pages will be much easier, since we've already done most of the hard work.
50
Replace whatever text you have in that field with "Site Map". Alternatively, if you want the name of your website in the title as well, call it "Site Map - Example Company" (where "Example Company" should be replaced by the real name of your site). Actually, you can call it what you want, but it's best to have "Site Map" somewhere in that title, since it's the name used by practically everyone for such a page. 3. Change the text in the "Page Title" editable region to "Site Map". 4. Replace the text and pictures in your "Page Content" section with a list of links to the rest of your site. The easiest way is to select the existing content, hit the DEL or backspace key to remove it, then type every page name on a separate line. Hit the ENTER key (or RETURN key on the Mac) after each name to make a new paragraph. Then select each line separately, and make them into links pointing to their respective pages. If you've forgotten how to make a line of text into a link, please see chapter 5, How to Make Pictures and Text into Clickable Links using Dreamweaver CS4. For your convenience, here are the links that you'll want to make:
o o o o
Page name: Home. URL: index.html Page name: Feedback. URL: feedback.html Page name: About Us. URL: aboutus.html Page name: Site Map. URL: sitemap.html
I realise that at this point in time, since you have so few pages, a site map probably seems very silly to you, especially since every page listed in the map is already linked to from your menu bar in the left column. However, the site map will become more useful (to your visitors) as you add more pages to your site. It also adds professionalism to the site, and makes it easier for search engines to locate all the pages of your website. If you find that hitting the ENTER (or RETURN) key creates too much blank space in between each filename, and you prefer that the filenames be more closely spaced, do this instead of hitting the ENTER key. After you type a line, say the word "Home", click "Insert | HTML | Special Characters | Line Break" from the menu. (If you are using Windows, you can hold down the Shift key and hit the ENTER key to accomplish the same thing.) Nothing will appear to happen visually, but if you immediately type "Feedback" after that, you'll see that "Feedback" is placed in a new line below "Home" without an intervening blank line. For the curious, the reason for this is that the ENTER key creates a new paragraph, hence the extra blank line, while "line break" merely moves what follows to the line below. 5. Click "File | Save As..." and type "sitemap.html" (without the quotes) into the "File name" box. Do not change the name, add spaces or change the capitalization: type the name as-is. This is because you have already used "sitemap.html" to link to this page in your navigation menu, so if you give this file some other name, your links to this page will be broken. Click the "Save" button.
51
How to Publish Multiple Pages the Easy Way with Dreamweaver CS4
Now that your website is nearly complete, with multiple pages, it is no longer efficient to use the old "Site | Put" method to publish your website. That method was useful when you only had one page to upload. When you have multiple pages, you will prefer Dreamweaver to automatically figure out which pages have been modified, and publish them for you without your having to manually open and publish every single one. 1. To do this, click "Site | Synchronize Sitewide..." from the menu. 2. A dialog box, "Synchronize Files", appears. The "Synchronize" field should read something like "Entire 'Example Company' Site" (where 'Example Company' is replaced by the name of the site that you gave Dreamweaver in chapter one). The "Direction" field should read "Put newer files to remote". If any of these is not the case, click the down arrow key in the appropriate drop down box to select the correct option. Click the "Preview" button. 3. Dreamweaver will immediately attempt to connect to your website to check the files that have previously been published. When it is complete, it will show a dialog box with a list of files that need to be uploaded. Unfortunately, this list of files includes your website template, which does not actually need to be published, so we will have to remove it from the list before we allow Dreamweaver to proceed.
52
Right-click the "Templates\index.dwt" line in the dialog box. That is, click the right mouse button when your mouse cursor is directly over the "Templates\index.dwt" line. A menu will appear. Click the "Ignore Selection" item in the menu. The "Action" column for the "Templates\index.dwt" line will now show "Ignore" instead of "Put". 4. Click the "OK" button. When Dreamweaver has finished uploading your pages, test your website using your web browser. This time, be sure to click the "Home", "Site Map" and "About Us" buttons in your menu bar to make sure that they lead to the correct pages. Congratulations! Your website is nearly complete. All it lacks is the feedback form, which we will create in the next chapter.
7. Another dialog box, "Update Pages", will appear. Click the "Close" button. 8. If you want to be sure that Dreamweaver has done its job properly, doubleclick any of your web pages in the FILES panel to open them in Dreamweaver. They should all reflect the change you made. 9. Upload your modified files using the "Site | Synchronize Sitewide" procedure described above.
You will have a working feedback form on your site. You will have completed your website and have a fully functional multi-page website. You will have learnt ("have learned" in American English) most of the commonlyneeded skills needed to create a website using Dreamweaver CS4 and have the knowledge and ability to create other websites if you wish.
click the "Submit" button till they are blue, and nothing will happen. This is because web pages are essentially just documents that live on the web. They can't send email, save data, or do anything except display information. The job of doing things like sending email is left to a computer program which must run on the same computer that your website is on. That is, the program must run on your web host's computer, which is known as a web server, since it serves web pages to your visitors. Such programs running on web servers are commonly called "scripts" in webmaster jargon. The process of sending email via a web form works this way: 1. Your visitors complete a form on your website. This form is known as your feedback form (or contact form). They then click the "Send" button on the form, in their browser. 2. The web browser sends the information to a script (program) residing on your website's server. 3. The script takes the information, formats it in a way that is appropriate for an email message, and sends it by email to your mail box. 4. The script then displays an acknowledgement page, or "thank you" page, so that your visitors know that their message has been successfully sent. 5. If there are errors in the message (for example, your visitors forgot to enter their email address), instead of displaying the "thank you" page, the script may display an "error" page so that the visitors will know that the message has not been sent. They can then fix the error and try again, if they wish. In other words, adding a feedback form to your website is not simply a matter of designing a web page with a form. You will need the following things before the form will work: 1. You need a web page containing the feedback form itself. You will design most of this page using Dreamweaver. 2. Another thing you will need is a "thank you" web page. This is also a simple web page which can be designed using Dreamweaver. 3. And then you will need an "error" web page. Again, this can be easily created with Dreamweaver. 4. The engine behind your feedback form is the feedback form script, the computer program that knows what to do when a web browser sends it the information submitted by your visitor. You will be using thesitewizard.com's Feedback Form Wizard to create a customized program for your site. Don't worry, it's free. 5. Finally, you will need a web host that will allow you to run PHP scripts (which are a type of computer program) that send email. Not all web hosts allow this, especially free web hosts. When I say free web hosts, I include the free hosting that comes with your broadband or dial-up account as well as that which you may get when you register a domain name with some registrars (sometimes called a "starter web page" or the like). Even if the free web host says you can run PHP scripts, they often don't allow the scripts to send email. In view of this, you will probably find that you need a commercial web host before you can successfully use a feedback form script. If you're looking for one, see the Budget Web Hosts page for a list of such hosts or visit my web hosting FAQ for the host that I'm currently using for thesitewizard.com.
55
o o
Go to the Free Feedback Form Wizard to generate a customized feedback form script. The wizard can be found at http://www.thesitewizard.com/wizards/feedbackform.shtml Read through the Wizard's introductory page, choose the option to create a PHP feedback form script and click "Go to Step 2". In Step 2, enter the information required by the form: Email: (Enter your email address) URL of Feedback Form: http://www.example.com/feedback.html URL of "Thank You" Page: http://www.example.com/thankyou.html URL of "Error" Page: http://www.example.com/error.html You should, of course, replace the "www.example.com" with your actual domain name. However, do not change the file name portions, especially "feedback.html" since you have used this filename in your navigation menu bar and site map in the previous chapters. If you change the filename now, all your old links will break.
o o
Read the licence agreement. If you agree to the terms, indicate it in the form and click the "Generate script" button to continue. A new page will load. Do NOT close this page. Leave it open while you work through the next few steps. We'll be extracting the code generated on this page section by section in the paragraphs that follow. Start up Dreamweaver. Select "File | New..." from the menu. Click "Blank Page" (yes, "Blank Page" and not your template) in the leftmost column. In the "Page Type" column, click "PHP". Click the "Create" button. A blank page should appear. Unfortunately, this page is not really blank, and we have to delete the rubbish that Dreamweaver inserted when it created the page. VERY IMPORTANT: click "View | Code" from the menu. You should now see the miscellaneous HTML code that Dreamweaver inserted into your php page. Select everything on the page. You can do this by using your mouse to drag over everything, or, more simply, hitting Ctrl+A, that is, holding down the Ctrl key and type "a". Then hit the DEL key. (Note: Mac users may need to use Command+A rather than Ctrl+A.) Your window should now be blank.
56
Switch back to your web browser (without quitting Dreamweaver) and look for the section entitled "Feedback Form Script". It should be the first section in the results page. Notice that there is a box under that section. That box contains the feedback form script (program). Select everything in that box. For Windows users, one way to do this is to click your mouse somewhere in that box to put your cursor inside it. Then hit Ctrl+A (hold down the Ctrl key and type "a"). Copy the selected text to the clipboard. The easy way is to type Ctrl+C (hold down the Ctrl key and type "c") in Windows. Alternatively, you can click the right mouse button and select "Copy" from the menu that appears.
o o
Switch back to Dreamweaver. Again, do NOT close your web browser. We're not done with it. Select "Edit | Paste" from the menu. The entire script generated by the Feedback Form Wizard should appear in your Dreamweaver window. The last line should show "?>" in red. There should be lines above in blue, red and black. If your screen is very large, you may also see lines in orange (or maybe it's yellow). If you do not see this multicoloured text, close the Dreamweaver window without saving anything, and restart this entire step (the "Saving the Script" step). Do NOT add, subtract or change anything in the window. Leave everything exactly as it is. There is nothing you should be customizing in this screen. This is a computer program that you're looking at, not a web page. It is not displayed to your visitors. If you modify anything at all, the program will fail to work correctly.
Click "File | Save As..." from the menu. Type "feedback.php" (without the quotes) into the "File name" box. Do not use any other name. Do not add spaces to the name. Do not use capital (uppercase) letters. The name must be exactly as I said. Click the "Save" button. Select "View | Design" from the menu. You should see a blank page. Do NOT type anything here. You're still in the program. Click "File | Close" from the menu to close the window.
Select "File | New..." from the menu. Since you have already created a template for your site in the previous chapter, select "Page from Template" in the first column. Make sure that the preview window shows the template that you've been using and that the "Update page when template changes" checkbox has a tick in it. Click the "Create" button.
57
o o
o o
o o o
You should be back in familiar territory. Change the "Title" field above your web page to "Feedback Form" (or "Contact Form" or "Contact Us" or whatever you prefer). Use the same text for the "Page Title" editable region. Select everything in the "Page Content" section and delete it. You will be replacing it with the form code. Switch back to your web browser, and locate the section entitled "HTML Code". Notice that there is a box in that section as well. Select everything in that box and copy it to the clipboard as before. (See above section if you've forgotten how to do this.) Switch to Dreamweaver. Make sure that your text cursor is in your "Page Content" editable region. Specifically, it should be at the position where you want to insert the form code. Click "View | Code" from the menu. Dreamweaver will now display the underlying HTML code of your web page. Look for your blinking text cursor on the page. It should be sandwiched between characters in a line that says "<p> </p>". In particular, it should be just after the "<p>" tag and before " </p>". Use the arrow keys on your keyboard and move the cursor to the end of the line, that is, to immediately after "<p> </p>" on the same line. Click "Edit | Paste" from the menu to paste the code you copied from the browser earlier. Click "View | Design" from the menu to switch back to the "Design" mode that you normally use. You should now be able to see the form.
The same method applies to the "Email" field. You can also change the text appearing in the web page next to the fields. That is, if you prefer something other than "Name:", "Email address:" and "Comments" being displayed on your web page, feel free to change them. (For example, you may want to translate it to the same language as the rest of your site, if your site is not in English.)
Caution
You should not modify anything in the PROPERTIES panel other than the "Char width" field and the "Class" field, which is basically the same as the "Class" field you met in chapter 3's How to Change Font Typefaces, Weight, Style, Colour and Sizes in Dreamweaver CS4. While you may freely modify things that affect the appearance of your web page (such as the "Char width" and "Class" fields), the other values appearing in the PROPERTIES panel may be used by the feedback form script to obtain the information it needs to send you the email. Modifying them may break the functionality of your form. In particular, do not change the words "fullname", "email" and "comments" appearing in the PROPERTIES panel, not even to translate them. Those are internal information used by the script and will not be displayed to your visitors, so there's no need to touch them. The form is actually designed to work out-of-the-box, so if you can't think of anything to change, don't feel obliged to do so. These sections are meant for the compulsive customizers.
o
The text appearing on the "Send Feedback" button can also be changed. This is especially important if your page is not in English and you want the button to display information in the correct language. To modify the text, click the button. Change the text in the "Value" field in the PROPERTIES panel. Once again, you should not change anything else in that panel, other than the "Value" and "Class" fields.
Message Sent
Your message has been sent to the webmaster. Thank you for your comments. If you are running a business, you may want to give a more customer-friendly message:
60
The second page that you need to design is the "Error" page. This page is displayed when your visitors fail to provide their name or email address when submitting the form. Since this information is needed by the script to create a properly-formed email message, the script (by default) displays the Error page if the information is missing. Again, there are no rules about what to say on this page. For those who are really stuck, here's one possibility:
Error
Please enter your name and email address before submitting the form. Click the "Back" button in your browser to return to the form to fix the error. When you've completed your Error page, save it with the filename "error.html". Again, do not use some other name, since this is the name that you gave the Feedback Form Wizard earlier. The exact name was embedded in the script created, so you should not change it if you want the script to work correctly.
Conclusion
61
Congratulations! You now have a fully functional website, complete with a home page, a site map, an "About Us" page and even a working contact form. More importantly, you now have the knowledge and ability to use Dreamweaver CS4 to design and publish new websites as and when you wish. If you're wondering where to go from here, check out the article The Beginner's A-Z Guide to Starting/Creating Your Own Website for an overview of the rest of the website creation process. Even though you have already finished your site, you should still read the section on "Designing Your Web Pages" for the links to other web design articles. Those articles deal with other principles of good web design not covered in this tutorial series.
62