Site-Management Tools
The final section of today's lesson will investigate the advanced Dreamweaver MX site-management tools. Yesterday you learned how to define a site; today you'll learn how to upload it to a remote server.
Configuring Remote Server Access
You already know the steps required to define a static site. Let's take that a step further, and look at how we can access remote files in Dreamweaver MX.
Begin the site definition as you normally would. Immediately after answering the "Would You Like To Use a Server Technology" (which you should answer "no"), you'll be presented with the choice of determining where your files are located. This dialog box is displayed in Figure 3.30.
Figure 3.30 This step determines where the files are going to be stored.
You have three choices for how Dreamweaver MX treats your fileseither storing them locally and uploading them when needed, editing the files on your local network (this is the same as mounting and editing from a network drive), and, finally, editing directly on an FTP or RDS (ColdFusion) server. It is highly recommended that you choose the first option, as it provides the best control over your files and is least prone to accidents.
If you choose to edit files directly on the server using a mounted volume, choose the second option. You will be prompted for the path to the server volume. From Dreamweaver's perspective, this is any folder that your computer has access toit doesn't care, as long as it can see it. If you're writing the site on the server itself, you can use this option and simply choose the folder the pages should be published to.
If you choose to edit the files directly on the FTP or RDS server, you'll still need to pick a local folder to hold a local copy of the filesthey aren't being edited on the remote server, despite the misleading dialog box. In order to edit a file, Dreamweaver MX will download it first, and then allow you to edit it. The "Automatically Upload files to the server every time I save" check box, when activated, keeps the local files automatically synchronized with the server. If this box is not checked, there's no difference between choosing this route, or storing the files locally and uploading them when needed (the first option for where the files will be stored).
If you choose the local Network option, click Next and you're done!
Assuming you chose to use FTP/RDS or store the files locally and connect as needed, the next setup dialog box is identical. (No, I don't particularly understand this either.) Figure 3.31 shows the remote connection setup dialog box.
Figure 3.31 The Sharing Files dialog box allows you to configure the setup of the remote server connection.
Regardless of how you got here, you have five possible choices for how to connect to a remote server:
Whatever option you choose, you'll need to contact your server administrator or ISP to find out exactly what information you need to enter for the configuration options. If you choose WebDAV or RDS, click the Settings box to open a configuration window and enter the share point information for these protocols. The FTP configuration is displayed directly within the setup window and features a Test Connection button for verifying the settings. This is only available if you're using FTP.
After configuring the connection with the information provided by your server administrator, click the Next button.
The final setup dialog box, not shown in this section, is for configuring the Check-In/Check-Out system for sharing editing with others. You'll learn how to set up Check-In/Check-Out in Day 5, "Creating Reusable Components." For now, set these options to "Do Not Enable Check-In and Check-Out."
Advanced Settings
A more straightforward way to edit remote server settings (especially if you've already created a site and want to upload it to a remote server) is to click the Advanced tab within the site definition and select the Remote Info category. Shown in Figure 3.32, this is similar to what you saw when choosing your server access method.
Figure 3.32 The Remote Info category provides direct access to your remote server settings.
Use the Access pop-up menu to choose between FTP, WebDAV, Local/Network, and RDS settings. RDS, WebDAV, and Local/Network offer no more features than available when doing a simple setup. FTP, however, provides additional settings for getting through firewalls. If you are behind a NAT or network-connection-sharing device, click the Passive FTP option, or your connections are likely to fail. Likewise, if your administrator uses a firewall, click the Use Firewall button, and then click the Firewall Settings box (the same as choosing Site in the Dreamweaver MX preferences). As with the basic connection information itself, I can't tell you what the firewall values will need to beit's dependent on your network setup.
Two additional options are available for the all the connection methods:
What Is a Testing Server?
You might have noticed that there is a category for Testing Servers in the Advanced Site Definition. This is a third location that your files could potentially inhabit. It is typically called a "staging" server and is used to test files before they are sent to the final remote server. The testing server is configured exactly like a remote server and is accessed through the Site panel, which you'll learn about next.
Cloaking
When working with your site files, you might have to deal with files and folders that aren't directly related to your pages (Photoshop files, content folders, or server files such as .htaccess files on Apache). To "hide" these files, you can use the Cloaking feature of the advanced site definition, shown in Figure 3.33.
Figure 3.33 Use a cloak to hide files not related to your site.
After enabling cloaking, you can also choose to enable cloaking files with a particular ending. More frequently, you'll choose to cloak an object by right-clicking it in the Site panel and choosing Cloak from the Cloaking menu, or using the Cloaking submenu in the Site menu. This menu can also be used to quickly enable or disable cloaking for a file, folder, or deactivate cloaking for everything.
Using the Connection
If you've set up a connection you're ready to try the file transfer features of the Site panel. Go ahead and connect to the remote site by clicking the Plug Connect button at the top of the screen. Figure 3.34 demonstrates a live connection between my local computer and a remote FTP site (with the site window expanded).
Figure 3.34 A live connection is made.
NOTE
If you are working in the single-paned panel view, you can switch to the remote site by choosing Remote View from the pop-up menu on the right side of the panel.
If your screen only shows the local files, click the small triangle in the lower-left corner of the file window so that it points to the right. You're now ready to transfer files between your local and remote sites.
NOTE
When the Dreamweaver Site panel is maximized and the Site Files icon is clicked, you'll see the local files on the right and the remote server files on the left. If you're using the "third" server (a testing server), you can switch to a view of the local files and testing server files by clicking the Testing Server icon.
Manually Transferring Files
The easiest way to move files between the different locations is to click and drag. An extremely beneficial feature of this process is that Dreamweaver MX will determine what the selected file(s) dependant files are, and it will offer to transfer them. This saves you the trouble of trying to find everything that goes with a certain fileit will be done automatically. You can drag individual files, multiple files, or even entire folders between these views.
Alternatively, you can follow the FTP model for file transfers and use the Put button (up arrow) to put files from the local directories onto the remote servers. The Get button (down arrow) retrieves files and folders from the remote server. A status bar in the lower-right corner of the Site Files window shows the progress of the files as they are transferred. Clicking the red stop sign by the status bar cancels the current action in progress.
If something goes wrong during the FTP process, you can view a log of the FTP commands sent to the remote server with the FTP Log option found in the Window menu or in the Site panel toolbar. There's a good chance you can find the solution to your problems here.
Refreshing the File View
If a file changes (is added or deleted) on the local or remote side without the knowledge of Dreamweaver MX, it probably won't show up in the file listing. If you feel that something isn't appearing on either side of the connection, you can refresh the files that are shown by clicking the refresh buttonthe circular arrow at the top of the site view. This will reload both sides of the display.
If you'd specifically prefer to force the local or the remote file lists to refresh, you can choose Refresh Local or Refresh Remote from the Site Files View submenu located under Site. This forces only the appropriate file listing to be reloaded.
Synchronizing Files
The most useful way of transferring files is through synchronization. Instead of trying to find all the updated files you need to transfer manually, you can ask Dreamweaver MX to help you determine what has changed. If you'd just like a list of what has changed, use the Select Newer Local and Select Newer Remote commands from the Site Files View menu. This highlights all the files in the respective list that are newer than the corresponding file at the other end of the connection. You can then drag the files over to the opposite side to synchronize the file listing. This, coupled with Dreamweaver MX's capability to also transfer dependent files, makes this a great way to keep things in sync without turning complete control over to Dreamweaver MX.
If you prefer to let Dreamweaver MX do all the work for you, choose the Synchronize selection from under the Site menu. As you can see in Figure 3.35, just click Preview, and Dreamweaver MX will compile a list of files that should be updated. If you'd like to modify the files being transferred, select/deselect the files you'd like. When ready, click OK to perform the synchronization process.
Figure 3.35 Synchronize your local and remote sites instantly.
With the Synchronize command, you can choose what you want to transfer (the entire site, or only selected files) and which way you want the transfer to take place (from local to remote, remote to local, or both). The final optionDelete Remote Files not on Local Driveremoves any files from the remote server that don't match something on the local side. Be very careful in choosing to select this option. If anything on the remote site doesn't have a corresponding local file, it will be deleted.
When you've finished transferring files to your site, click the Disconnect button to close the connection between your computer and the remote server.
Generating a Site Map
The final feature we'll look at in the Site panel is Dreamweaver's Site Map feature. Site maps become extremely handy as the number of files in your site increases. It provides a different view of the files that comprise your Web presence.
If you have defined a site and created a few pages, go ahead and switch to that site using Open Site under the Site menu. If you haven't yet worked with a site, you can use one of the Dreamweaver MX tutorial sites to see how the site map function works.
You can switch to the Site Map view by clicking the site map icon (the third icon from the top left) in the Site panel. Alternatively, you can just select Site Map from the Window menu to automatically switch to this mode. For example, choose the Day 3 site in the Site pop-up menu, and then switch to the Site Map view. Your display should look similar to the one shown in Figure 3.36. Nice feature, isn't it? What makes it even better is that this view is actually very useful besides being pretty. Let's go through the parts of the site map screen and their uses, and then take a look at the things you can do from within this view.
Figure 3.36 The site map view gives you a visual overview of your site's layout.
The Dreamweaver MX site map tool is very similar to a hand-created site map, but offers some definite benefits from having direct access to the HTML itself.
Understanding the Icons
Each of the icons in the site map display represents a page that it is linked to in the site. Two primary types of icons are local and remote. Local site documents are shown using the standard Dreamweaver MX document icons. Documents that are linked to remotely are shown as a generic text style icon with a small globe in the lower-right corner.
These two icons are the primary placeholders for a page on your site map. You can take the map one step further and display all files that are linked into your site (images, style sheets, and so on), by choosing Show Dependent Files from the Site Map View under the Site menu. This can be a bit overwhelming and rarely seems to be of much useon Windows platforms this is accessible directly from the View menu in the site window.
By default, the names of the icons are set to the name of the HTML file. You might find it more intuitive to switch the files to display the name of the HTML page (derived from the <title> tag) rather than its file system name. To switch to this view, visit the Site menu again and choose the Show Page Titles option from the Site Map View submenu. You can also set these options from within the Site Map Layout section of the Site Definition dialog box.
TIP
Titling your HTML documents is very important in providing a perfect browsing experience to your viewers. Without page titles, bookmarking a page is more or less useless. Properly defined page titles help the users navigate and find previously saved information quickly.
Using the Show Page Titles option makes it easy to locate the files that don't have their <title> tags set. Just scan for the Untitled label.
If there is a file that you don't want displayed in your site map, you can mark it as hidden under the Site menu using Show/Hide Link options. Unfortunately, if you hide a link, it's difficult to select it to use the Show option. Luckily, you can choose Show Files Marked as Hidden to show everything. This is another one of those strange Dreamweaver MX interface elements that doesn't seem to be completely intuitive. Hidden files will be shown in italic.
One last feature of the icon view is the coloring of the icon label. Broken links are highlighted using redthis makes it very simple to find problems with your site just by looking for the highlighted icons.
Viewing Links
As you've already seen, the connecting lines represent the links between files. Often lines are not spaced as carefully as one would hope. You can change the spacing between linked files by positioning your cursor over the vertical spacing lines and using your mouse to drag the lines over. Near each icon representing a local page is a small target icon, similar to what you've seen for making links from the Properties panel to other files on your site. You can add links between pages by clicking and dragging between the target and the page you want to link to. This will add a simple text link at the bottom of the HTML page to the target page. You'll need to open the page and put the link where you want itdon't expect it to automatically show up in your nice graphical navigation system. An alternative way to perform this function is by choosing the Make Link option under Modify.
If you want to change the spacing of the icons in the site map view, just position your mouse over one of the connecting arrows and drag.
If your site is more than a single layer deep, you've noticed that pages are missing from the map. The Dreamweaver MX mapping tool only shows the main level of the site. The lower levels of links can be revealed by clicking the plus and minus icons located near every document icon. You can collapse and expand the tree of links to show or hide as much of the site as you need.
If you'd like to move down the tree, you can select another file to be the root node of your site map. Clicking one of the icons in the site map and selecting View as Root from the Site, Site Map menu (or the contextual menu) will move that icon to the top of the site map display window. The top of the site map shows where in the site hierarchy you're currently viewing, as seen in Figure 3.37. You can click the levels shown in the window header to move up in the site tree.
Figure 3.37 Use the top of the site map window to navigate through the levels of the site hierarchy.
Similarly, if you'd like to redefine which file is the home page of your site, you can select the file in the local file listing and use the Set as Homepage selection. You can also use the New Home Page option to create a new HTML file that will become the root of your site. Personally, I've never found an applied use for these options.
A few useful options are Change Link and Remove Link. If you select an icon and then Change Link, Dreamweaver MX will bring up the standard link selection dialog box. Selecting a new link will replace all links in your site that referenced the old file so that they point to a new location. Choosing Remove Link will remove links in the site that point to that file. It might seem a bit confusing at first, but you're not really modifying the file that is selected, you're modifying the files that point to the selected file.
Selected Files
Within the site map, you can use a standard file selection rectangle to select multiple (or single) local files. Cumulative statistics for these files will be shown in the status bar of the site map window. As you select files within this view, notice that the corresponding site files are selected in the file list on the right side of the panel.
Miscellaneous Site Map Options
A few other options can be set that alter the display of the site map. Choosing Layout from the Site Map View menu will open the Layout portion of the site definition window. Again, the Dreamweaver MX interface is a bit confusing here. The only settings found here that you haven't seen already are Number of Columns and Column Width. The Number of Columns parameter is used for configuring how many columns of icons are shown in each row of the site map. Column Width is a value, given in pixels, that will be used to set the default width of an icon and its label as shown in the site map view.