Chapter 10. Testing and Publishing a Web Site

Testing and Publishing a Web Site
  • Testing Web pages in different browsers

  • Using the Dreamweaver link-testing features

  • Publishing a site with a Web server

  • Using the Dreamweaver FTP features

It's a shocking scenario: You create a page design that looks just perfect in your favorite Web browser on your own computer. You publish it on the Internet and tell all your friends. And the next thing you know, your cousin in Iowa and your friends in Brazil are telling you that it looks terrible, the text is unreadable, and your Flash files don't play at all.

Don't let this happen to you. Take time to test your work before you publish the site for the entire world to see so you can make sure that it will work well in all the different Web browsers, operating systems, and monitor sizes that your visitors are likely to use.

Before you "go live" with your site, preview your pages in as many Web browsers as possible to make sure that your site looks the way you intend in the many different browsers in use on the Internet. If you don't have that many browsers on your own computer, don't worry. You can find many tips in this chapter to help you, including a collection of online services where you can test how your site will display in dozens of Web browsers on four different operating systems.

And, as you'll discover in the tasks in this chapter, it's a relatively simple step to use the many Dreamweaver testing features to ensure that all your links work properly, and to check for common compatibility problems that can lead to differences in browser display.

In the first part of this chapter, you find detailed instructions for previewing pages and using the Dreamweaver testing tools. In the second part of the chapter, you find out how to use the built-in Dreamweaver File Transfer Protocol (FTP) features to copy your Web site from your hard drive to a Web server on the Internet. And finally, you find instructions for adding Google Analytics (and other traffic-tracking services) to your site so you can see how many people visit your pages, where they come from, and how they get there — all of which play an important part of gauging the effectiveness of your site.

Tip

If you haven't been there already, check out Chapter 3 for recommendations and tips for choosing the best Web hosting and registering a domain name.

Understanding How Web Pages Look on Different Computers

One of the more confusing and frustrating aspects of Web design is that you can create a page that looks great in Dreamweaver and test it in a browser to confirm that it looks fine only to discover later that it looks terrible in a different browser or on a different computer system. Web pages can look different from one system to another for many reasons, but the following issues are the most common culprits:

  • Browser differences: Today, dozens of browsers are in use on the Web, not counting the different versions of each browser. For example, at the time of this writing, Internet Explorer (IE) 8 is the newest release from Microsoft, but a significant percentage of Web users haven't upgraded yet and are still using IE6 or even earlier versions. (More on browser differences in the next section.)

  • Hardware differences: Another challenge comes from the differences between Macintosh and Windows computers. For example, most fonts appear smaller on a Macintosh than on a PC (Times 12 on a PC looks like Times 10 on a Mac). Image colors can also vary from one computer to another.

  • Individual resolution settings: In addition, the same Web page may look very different on a 21" monitor than it does on a 15" monitor. And even on the same monitor, different resolution settings can alter the way a page looks. On a PC, a common resolution is 1024 × 768; on a Mac, the resolution is generally set much higher, making the design look much smaller, even if the monitor sizes are the same.

As a result of all these differences, the same Web page can look very different to the many people who visit a Web site. For example, Figure 10.1 shows a Web page in Internet Explorer on a PC, and Figure 10.2 shows the same page in Safari on a Macintosh. Notice that the text displays in a larger font size on the PC, changing how the text wraps around the photo in the left column.

This challenging aspect of the Web is at the root of many of the limitations and complications of creating good Web designs. With patience, testing, and an understanding of the tags and styles that are most problematic, you can create great Web sites that look good to most, if not all, of the people who visit your Web site.

A Web page displayed in IE 6 on a PC with the monitor set to 1024 × 768 resolution. Note that the right column has been bumped down below the left column, a common problem in IE6.

Figure 10.1. A Web page displayed in IE 6 on a PC with the monitor set to 1024 × 768 resolution. Note that the right column has been bumped down below the left column, a common problem in IE6.

The same Web page displayed in Safari 3 on a Mac with the monitor set to 1280 × 800. This is how the designer expected the site to look.

Figure 10.2. The same Web page displayed in Safari 3 on a Mac with the monitor set to 1280 × 800. This is how the designer expected the site to look.

Understanding How Browsers Affect a Site's Appearance

Of the many reasons why Web pages can look different from one browser to another, it boils down to this: Web browsers have evolved over the years to support new technologies on the Web. Thus, many older browsers still in use have trouble displaying some of the advanced features you can use on your Web pages today. Compounding this problem, the companies that make Web browsers — including Microsoft, Google, and Apple — don't all agree or follow the same rules (although most are getting better at complying with the same set of standards in their latest browser versions). Dozens of browsers are now in use on the Web, not counting the different versions of each browser. For example, as I mention earlier, IE8 is the newest release from Microsoft (at the time of this writing), but a significant percentage of Web users haven't yet upgraded and are still using IE7 or even IE6, which is notoriously bad at displaying CSS (Cascading Style Sheets) and other modern Web features.

The result is that the same Web page can look significantly different to the many people who visit a Web site. The differences can become even more pronounced in older browsers or in monitors of different sizes.

This challenging aspect of Web design is at the root of many of the limitations and complications of creating Web sites that look good to everyone who may visit your pages. HTML was designed to help ensure that Web pages look good on every computer on the planet, and as a result, some of the rules of Web design may seem strange or limiting at first. Despite these efforts, and a growing movement toward more standardized Web development, getting your pages to look exactly the same on every computer on the planet is difficult if not impossible. As a result, most designers strive to create pages that look as good as possible on as many browsers as they consider important, even if the same pages don't look exactly the same on all browsers.

Which browsers you should design for depends on your audience. If you have the luxury of having accurate reports on the visitors to your site, you can see a list of all browsers used by visitors to your site. (At the end of this chapter is information about using Web-statistic services that include browser usage information.) For example, your Web statistics may reveal that 27 percent of your audience uses IE7, 18 percent uses IE6, 25 percent uses Firefox 3, 23 percent uses Firefox 2, 5 percent uses Chrome, and 2 percent uses Safari. With those numbers in mind, you may decide that your pages should look attractive in IE and Firefox, but you'll settle for them not looking quite as good in Safari and Chrome, which at this point have lesser percent of your audience and display some features quite differently.

Entire books and Web sites are dedicated to the differences among browsers, and how to best design for everyone on the Web. To help keep things simple for you, I include templates in this book that are designed to look best in the most recent and most commonly used browsers on the Web, including IE8 and IE7, and Firefox 3 and 2. However, you should note that making significant changes to these designs may result in unpredictable results, which is another important reason to test your work thoroughly before you publish your site.

Previewing Web Pages in Multiple Browsers

Previewing your Web pages in a variety of Web browsers is the simplest way to make sure that they look suitable to at least most of your visitors. The following task walks you through the process of adding browsers to Dreamweaver for easy previewing and for viewing the same Web page in multiple browsers.

  1. Open a Web page that you want to preview in Dreamweaver, choose File

    Stuff You Need to Know
    Stuff You Need to Know
  2. Study the page carefully, testing all the links, rollovers, and any other special effects to make sure that the page appears how you want in this browser.

    Stuff You Need to Know
  3. Return to Dreamweaver to make any changes you want to the page. Then test the same page in other Web browsers. To add browsers to the preview list, choose File

    Stuff You Need to Know
    Stuff You Need to Know
  4. After the Preferences dialog box opens to the Preview in Browser settings, click the plus (+) sign at the top of the dialog box to open the Add Browser dialog box. Enter a name for the browser. (I like to include the version number as well as the name, as I have here, with Firefox 3.) Then click the Browse button.

    Stuff You Need to Know
  5. Find the browser you want to add on your hard drive, click to select it, and then click Open to add it to the browser list in Dreamweaver. Note: You can add only those browsers to Dreamweaver that are on your hard drive. (See the nearby sidebar "Downloading new browsers" to find out more about finding and downloading new browsers for testing.) Look for the browser's executable file (with an .exe extension) rather than a shortcut on your desktop that you may use to launch the browser.

    Stuff You Need to Know
  6. Repeat Steps 3–5 to add more browsers to the list. You can then designate which browser you want as your primary browser: the browser that's launched when the F12 key is first pressed. You can also designate a secondary browser, which appears second on the list and will launch and display the same Web page if you press Ctrl+F12 on Windows or

    Stuff You Need to Know
    Stuff You Need to Know
  7. You can also preview a page in a browser by clicking the Preview/Debug in Browser icon (it looks like a globe), at the top of the workspace, and selecting any browser from the list.

    Stuff You Need to Know
  8. Adobe Device Central is available in Dreamweaver versions CS3 and CS4. (You don't have this option if you'reusing an older version of Dreamweaver.) Device Central is designed to help you create and test Web sites for mobile devices, such as cell phones. Using Device Central, you can preview your Web pages in many different cell phone models by first clicking the plus sign next to the device type and then any of the devices listed within each group.

    Stuff You Need to Know

Testing Sites with Online Browser Emulators

Unless you own a dozen computers with different operating systems and a vast collection of Web browsers, you can't fully test your Web site on your own. Fortunately, a growing number of online services are available to help you preview your pages on many different operating systems and browsers, without having to manage multiple computers and browsers yourself.

Here are some of the best places to test your Web site online:

Xenocode Browser Sandbox (www.xenocode.com/Browsers). The Xenocode browser sandbox makes it easy for you to test a site using any of the eight most popular browsers without having to install them all on your system. You simply download and install a plug-in from the Xenocode site and then click the browser you want to use. After the selected browser launches, you can surf the Web as if the browser were installed on your computer. The service is free (at the time of this writing). And because you can surf through the browsers, you can interact with Web sites, testing all your pages, as well as JavaScript, AJAX, and other interactive features.

Adobe Browser Labs (https://browserlab.adobe.com). Adobe Browser Labs makes it possible for you to test any Web page on the Internet in the most common browsers. At the time of this writing, that includes IE versions 6 and 7, Mozilla Firefox versions 2 and 3, and Apple Safari version 3. You can also test pages on different operating systems, such as Windows XP and Mac OS X. When you use this service, the result is a screenshot with a preview of the page, which offers a quick and easy way to test pages' display. Small downside: You can't test interactive features, and you can test in only two browsers at a time.

Cross Browser Testing (www.crossbrowsertesting.com). The Cross Browser Testing site takes Web site—testing to another level. Instead of simply providing screenshots of a Web page in different browsers, or letting you launch a few browsers to test pages in, this site lets you take over other computers connected to the Internet so that you can test interactive features using a variety of browsers and operating systems. For example, if you use a computer that runs Windows Vista and you want to see what your site will look like on a Mac, you can choose to use a computer with the Mac OS and then view your site in any of a dozen browsers on the Mac system. The advantage is that you get more than snapshots, and you also can test interactive features, such as JavaScript, AJAX, forms, and more. This service requires that you purchase a monthly subscription.

Browsershots (www.browsershots.org). Browsershots is a popular online testing tool. You simply enter a page's URL and choose the options you want to use for testing. Browsershots then tests the page you submitted on each computer system selected with the specified browser and takes a screenshot. Although you can't test interactive features with this service, it's one of the easiest options and provides the largest collection of browsers to choose from. (You find instructions for using Browsershots in this task.) The basic service is free, but it can take a few minutes or a few hours to complete testing. If you don't like waiting, you can upgrade to "priority processing" for a fee.

  1. At www.browsershots.org, enter the URL of the page you want to test in the Enter URL Here field. (Note: You can test only those pages that are published on a Web server, but you can test any of those pages. For example, I can test www.californiawildlifephotography.com (as I'm doing here), and I can also test www.californiawildlifephotography.com/gallery to (test the gallery page separately). Browsershots can test only one page at a time.

    Stuff You Need to Know
  2. Browsershots offers an exhaustive array of browser options (more than 92 different Web browsers and versions to choose from), and you can choose to test any browser available on any or all of the major operating systems, including Linux, Windows, Mac OS, and BSD. You can't, however, select specific versions of these operating systems. Place a check mark next to each browser you want to test, but keep in mind that the more options you choose, the longer it will take.

    Stuff You Need to Know
  3. The result is a collection of thumbnail screenshots that give you a literal snapshot of how your page looks across many different browsers and systems. It can take a few minutes or a few hours to complete testing, depending on how busy the service is and how many options you choose.

    Stuff You Need to Know
  4. Click any of the thumbnail images to see a slightly larger version. If you find that a page doesn't display properly in a browser, such as the one shown here in IE6, you can then use Dreamweaver to make adjustments to the page layout and test it again to see whether the display improves.

    Stuff You Need to Know

Using the Dreamweaver Link-Testing Features

Test, test, and test some more. To help you ensure that all the bells and whistles on your Web site ring and ding the way they should, a variety of Dreamweaver features make it easy to test your pages for broken links and other potential problems. In the task that follows, you find instructions for using some of these high-powered testing tools on a completed Web page.

  1. Make sure that the site you want to test is selected and active in the Files panel. (To open the Files panel, choose Window

    Stuff You Need to Know
    Stuff You Need to Know
  2. To test the links in a Web site, choose Site

    Stuff You Need to Know
    Stuff You Need to Know
  3. The report from the Check Links feature is displayed at the bottom of the workspace. If Dreamweaver reports a broken link, like the one shown here (to the about me.html file), double-click the filename. Dreamweaver highlights the corresponding text or image with the broken link so that you can easily see where you need to fix the link.

    Stuff You Need to Know
  4. You can fix broken links in a number of ways; the simplest is to reset the link by following the same steps you find in Chapter 6 for creating links. As in the example shown here, where I'm fixing a link from one page in a Web site to another page in the same site, start by making sure that the linked text is selected. Then click the Browse button (the yellow file folder icon next to the Link field) in the Property Inspector to locate the correct filename. (For more detailed instructions on creating links, see Chapter 6.)

    Stuff You Need to Know
  5. In addition to identifying broken links to pages within a Web site, the Dreamweaver link report lists other kinds of links. For example, you can use the drop-down list shown here to view all the external links, or links in a site that go to other Web sites. This makes it easy to test links to other sites to make sure that the Web site address hasn't changed. Note that to check external links, you must preview a page in a browser on a computer with an active Internet connection. You also display a list of unused files in a site by choosing Orphaned files from the drop-down menu. Orphaned files are HTML pages that aren't linked to any other pages, as well as images and multimedia files that aren't inserted into any pages in your site.

    Stuff You Need to Know

Setting Up FTP in Dreamweaver

Okay, you created a Web site and tested it, and you're ready to upload it to the Web. It's time to put the Dreamweaver publishing tools to work. If you're using a commercial service provider, you most likely need the Dreamweaver FTP features, covered in detail in this task and the remaining tasks in this chapter.

Note that you must complete the site setup process, covered in the beginning of Chapter 6, before you can configure the site for uploading. You also need the following information from your Web hosting service (find tips for choosing a Web host in Chapter 3):

  • The FTP host name

  • The path to the Web directory (optional but useful, and should look similar to this: /web/htdocs/jcwarner)

  • An FTP login or user name

  • An FTP password

After you gather all your FTP information and complete the site setup, you're ready to access the Dreamweaver publishing tools and prepare the program to upload your Web site. In this task, you set up Dreamweaver to connect to your server via FTP, a process you need to do only once for each site you work on. In the next task, you use Dreamweaver to upload pages to your server by using the connection you establish in this task. Follow these steps:

  1. Choose Site

    Stuff You Need to Know
    Stuff You Need to Know
  2. In the list of defined sites, select the site you want to publish. Then click the Edit button.

    Stuff You Need to Know
  3. Select the Advanced tab at the top of the Site Definition dialog box, and then select the Remote Info category from the left side.

    Stuff You Need to Know
  4. Click the arrow for the Access drop-down list box, and then choose the publishing option best suited to your Web server and development environment. If you're using a commercial Web host (the most common option for small do-it-yourself sites), choose FTP. If you're working at a university, a large company, or an organization that has its own Web servers, refer to the nearby sidebar, "The multiple Dreamweaver publishing options," to understand your choices here, and check with your system administrator to find out which option is best for your system.

    Stuff You Need to Know
  5. In the FTP Host text box, type the host name of your Web server. In my example, I used ftp.austinrelax.com. In the Host Directory text box, type the directory on the remote site in which documents visible to the public are stored. In my example, I used /web/austinrelax/. The information you enter in this field depends on your server. In some cases, you can leave the field blank if you log in directly to your site; in other cases, you use a different path, such as users/mysite/domain. Check with your service provider or site administrator to find out how your server is set up.

    Stuff You Need to Know
  6. Enter your login name and password. Web services require a username and password to gain access to your Web server to ensure that you're the only person who can make changes to your Web site. If you select the Save check box, Dreamweaver stores the information on your local computer and you don't have to retype it every time you log in to your Web server. Click the Test button to make sure that you entered everything correctly. If there are no problems, Dreamweaver responds with the message Adobe Dreamweaver CS4 connected to your Web server successfully.

  7. Select the Use Passive FTP option or the Use Firewall option only if your service provider or site administrator instructs you to do so. If you use a commercial Web hosting service, you shouldn't need to select any remaining options in this section of the dialog box. Select the use Secure FTP check box if you have a secure Web server, but be aware that not all hosts support secure FTP. If you select this option and see an error message when you press the Test button, deselect the option and test again.

    Stuff You Need to Know
  8. Select the Maintain Synchronization Information check box; Dreamweaver then automatically keeps track of any changes you make to pages on your local computer that haven't been uploaded to the server. Note: I never recommend that you select the Automatically Upload Files to Server on Save check box because I think that you should test your pages on your local computer before you publish them to the local site. Leaving this box deselected prevents the possibility of accidentally uploading errors automatically every time you save a page on your local computer. The Enable File Check In and Check Out option opens an advanced feature that can be used to track files when multiple people are working on a Web site. You can find more information on this and other site management features in my book Dreamweaver CS4 For Dummies (Wiley).

    The multiple Dreamweaver publishing options
  9. Click OK to save your Web server information settings and close the Site Definition dialog box. You're ready to start using the Dreamweaver FTP features, covered in the next section.

Tip

If you try to connect to your server and see the message An FTP error occurred, it usually means that you entered characters incorrectly. Be very careful as you type your username, password, and other information because most servers are case sensitive and require that these fields be filled in with the exact host, directory, login, and password information. If you still have trouble, contact your service provider or site administrator to ensure that you have all the correct information for connecting to your server. Setting up all this information correctly the first time can be tricky, and each service provider is different.

Uploading Files with the Dreamweaver FTP Features

After you enter all your Web server and login information into Dreamweaver (as you do in the previous task), you can upload files to your server and retrieve them at any time by using the built-in FTP capabilities of Dreamweaver.

To transfer files between your hard drive and a remote server, follow these steps:

  1. Make sure that the site you want to upload is selected and visible in the Files panel and that you entered all the FTP settings described in the previous section. Then, in the upper-left corner of the Files panel, click the Connects to Remote Host icon. (It looks like a plug and an outlet.)

    Stuff You Need to Know

    Tip

    If you're not already connected to the Internet, the Connects to Remote Host icon attempts to start your dialup connection. If you have trouble connecting this way, try establishing your Internet connection as usual to check e-mail or surf the Web, and then return to Dreamweaver and click the Connects to Remote Host icon after establishing your Internet connection. When your computer is online, Dreamweaver should have no trouble automatically establishing an FTP connection with your host server.

  2. When the connection is established, the blue Connects to Remote Host icon changes to look like the plugs are connected (or, dare I say, plugged in). After the connection is established, you can view the files and folders on your Web server by choosing Remote View from the drop-down list in the upper-right corner. (It's shown open in this figure.) Using the drop-down arrow, you can easily switch between Local view (displays the files and folders in the root site folder on your local hard drive) and Remote view by selecting each one in turn.

    Stuff You Need to Know
  3. To see both Local and Remote views simultaneously, expand the Files panel by clicking the Expand icon, in the upper-right corner of the Files panel. With the panel expanded, you can upload and download files by dragging them from one pane to the other. To minimize the Files panel, click the same icon again. In this figure, the Files panel is expanded and the cursor is hovering over the icon, which is labeled Collapse when the Files panel is expanded.

    Stuff You Need to Know
  4. To upload a file (transfer a file from your hard drive to your Web server), select the file from the Local View panel (which displays the files on your hard drive) and click the Put Files icon (the up arrow) in the Files panel. If a dialog box appears with the message Put dependent files, choose No to upload only the selected file. Choose Yes, and Dreamweaver uploads the selected file, plus any files that appear within that file, such as images or multimedia files that are inserted into a page.

    Stuff You Need to Know
  5. Files are copied to your server when you transfer them, leaving the file on the local computer untouched. You can select multiple files or folders to be transferred simultaneously.

    Stuff You Need to Know

    Warning

    When you copy files to or from your server, the files you're transferring overwrite the files already at the destination. Dreamweaver notifies you about the overwriting if it notices that you're replacing a newer version of a file with an old one, but it's always a good idea to double-check before you overwrite a file.

  6. To download files or folders (transfer files or folders from your Web server to your hard drive), select the files or folders from the Remote Site panel (which displays the files on your server) and click the Get Files button (the down arrow) in the Files panel. The files are automatically copied to your hard drive when you transfer them.

    Stuff You Need to Know

Tip

After you upload files to your server, test your work by using a Web browser to view the pages online. Sometimes, things that look and work fine on your computer don't work on the server, so you should always test the pages on the server right away.

Adding Google Analytics to your Site

One of the greatest advantages of publishing information on the Web is that you can track how people use that information, how they find it, where they come from, and more. There are many ways to gather data about visitors to your Web site. Most Web hosting services provide access to some kind of server logs that include basic information, such as how many people visit your site every day, week, month, or year.

If you want more information, consider using one of the third-party statistic services, such as Google Analytics, covered in the next task, or any of the similar services included in the sidebar, "Using online Web-traffic services." Google Analytics is the most popular Web traffic—reporting software available on the Web today. And it's no surprise. Google Analytics is powerful, comprehensive, remarkably easy to use — and free!

Follow these steps to add Google Analytics to your site.

  1. Sign up for an account at Google Analytics (www.google.com/analytics). If you already have a Google account, such as one you use for Gmail, just click the big blue Access Analytics button, and you can use your existing account as you sign up for Analytics. If you're new to Google, click the Sign Up Now link and create a new account when you sign up for Analytics.

    Stuff You Need to Know
  2. After you set up an account, just enter your user name and password to access your account. When you log into Google Analytics, if you already have sites set up with tracking, you'll see them listed on the Overview page. To set up a new site, click the Add Website Profile link at the bottom of the Overview page.

    Stuff You Need to Know
  3. On the Create New Website Profile page that appears, select Add a Profile for a New Domain if you're setting tracking for the first time, or select Add a Profile for an Existing Domain if you want to track a domain with a second profile. Enter the URL of the site you want to track, select the country and time zone from the drop-down lists, and then click the Finish button at the bottom of the page.

    Stuff You Need to Know
  4. Google Analytics provides you with two options: New Tracking Code (ga.js) or Legacy Tracking Code (urchin.js). I recommend using the new tracking code so you have access to the latest and greatest new features that aren't available via the legacy code. Select the entire code block in the input box and copy it. Then click the Finish button at the bottom of the page to return to the Overview.

    Stuff You Need to Know
  5. To add the code to a page in Dreamweaver, click the Code button at the top left of the workspace, and then scroll down to the bottom of the Web page where you want to add the code. With the cursor or mouse, select the line immediately before the </body> tag and then press Enter on your keyboard. Choose Edit

    Stuff You Need to Know
    Stuff You Need to Know
  6. To add Google Analytics code to a WordPress blog, log into the Administrative tools for your blog (as if you're going to add a new post) and then choose Appearance from the left side of the Dashboard. Under Appearance, choose Editor; then, on the right side of the page, under Templates, choose Footer (footer.php). Scroll down to the bottom of the page code; just above the close body tag </body>, paste the code from Google Analytics. Click Update File, and all the pages in your blog will be tracked automatically.

    Stuff You Need to Know

Tip

If you use Dreamweaver's .dwt template feature in your Web site, add your Google Analytics to the template in an uneditable region, and it will automatically be added to all the pages created from the template. See Chapter 6 for more information on templates and adding code to your pages in Dreamweaver.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset