6.7 Cleaning Up a Site

Dreamweaver can check for broken links and orphaned files on a file-by-file basis or for the entire site. It also warns you about external links, which can be verified manually or using the External Link Checker extension discussed in Chapter 22.

To check your complete site for broken links, use Site figs/u2192.gif Check Links Sitewide, Ctrl+F8 (Windows), or Cmd+F8 (Macintosh). This opens the Link Checker dialog box, shown in Figure 6-15, giving you a list of the Broken Links, External Links, and Orphaned Files that were found within the site.

Figure 6-15. The Link Checker dialog box

The broken links that occur when developing a site can be repaired easily from this dialog box.

Clicking the Save button in the Link Checker dialog box saves the Link Check Results. It does not save or resave the selected files. When fixing broken links, the corrected files are saved automatically.

6.7.1 Broken Links

Broken links are links that point to a file that can't be found. To display broken links, select Broken Links from the Show drop-down list in the Link Checker dialog box. Double-clicking a filename in the files list opens that document, which helps determine exactly which link is broken.

To fix a broken link, select the bad URL from the Broken Link column in the Link Checker dialog box. You can hand-edit the link or browse to a new file using the folder icon that appears next to it. (If you can't see the folder icon, widen the column by dragging the vertical line that separates the columns .)

After fixing a broken link, press the Tab key or the Enter Key (Windows) or Return key (Macintosh) to proceed to the next link. Dreamweaver asks you whether it should update the link everywhere it was used within your site. If you answer No, Dreamweaver corrects only the single bad link. If you answer Yes, Dreamweaver attempts to automatically update occurrences of the bad link throughout your site. If File Check In/Check Out is enabled, it attempts to check out files before performing the update and check them back in afterwards.

Broken links may or may not represent a true problem. For example, links to external programs, such as CGI scripts, may be flagged as broken links, but need not necessarily be fixed. Use the Site figs/u2192.gif Change Links Sitewide option (in the Site window under Windows or the main menu bar on the Macintosh) to replace links sitewide, whether broken or not.

6.7.2 Searching for Orphaned Files

Orphaned files are those files that are not used anywhere within the site; they may link to other files, but no other files link to them (i.e., there are no incoming links to this file). To display orphaned files, select Orphaned Files from the Show drop-down list in the Link Checker dialog box.

There is no automated way to remedy orphaned files. For each orphaned file you may opt to manually:

  • Create a link to it from another document, if it is a needed file.

  • Remove it from your site and delete it from server during the next synchronization to keep the server clean and save space.

  • Create a separate folder for orphaned files in case you need them later.

If you synchronize all files on a site, Dreamweaver will upload orphaned files as well, so it is best to remove them from your local site folder before synchronization.

6.7.3 Checking External Links

External links are links that refer to resources outside your web site, including other web sites, such as http://www.amazon.com, and email links, such as mailto:wish-dreamweaver@macromedia.com . To see a list of external links (including email links), select External Links from the Show drop-down list in the Link Checker dialog box. Links that begin with the address specified in the HTTP Address field (under the Local Info category in the Site Definition dialog box) are considered local links.

By default, Dreamweaver doesn't verify external links. You have a number of options for verifying external links:

  • Download and install the External Link Checker utility from the Dreamweaver Exchange. This extension can check external links in a single document or an entire site. See Chapter 22 for details.

  • You can check external links manually by copying and pasting them into the address line of a browser.

  • If you save the list of external links using the Save button in the Link Checker dialog box, you can use another program to check the links. For example, if you open a list of links in Eudora, all the links will become "hot" and you can click on each one to test it. Instead, you might import the list of links into a program that can automatically verify external links, such as Adobe SiteMill.

Dreamweaver in a Nutshell
Dreamweaver in a Nutshell
Year: 2005
Pages: 208

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net