WHAT YOU’LL LEARN IN THIS HOUR:
- How to define a website by using the Site Definition Wizard
- How to modify a website definition
- How to organize a website
Dreamweaver makes it very easy to open and edit single web pages—much like you would a word processing document. If you’re planning to create multiple pages, however, the very first thing you should do is define a site. That’s what you’ll do this hour. Defining a site gives you a home base to work from. Without a site definition, Dreamweaver may run into difficulties linking or organizing your files.
You use Dreamweaver’s Files panel to plan, create, and manage projects. Eventually you’ll have lots of files: web pages (HTML, or hypertext markup language, files), image files, CSS (Cascading Style Sheets) files, and other types of files. It’s important that you define your website to start off on the right foot.
Defining a New Website
This hour introduces creating a storage directory for your website and then telling Dreamweaver about it. This directory will be the home of your site, and you’ll build a logical structure beneath it with directories to hold supporting files such as images, scripts, and style sheets (more about this in later hours). Many beginning web developers simply start making web pages, skipping the site definition step—this is not recommended. You’ll make your web development life easier by completing this important step before any development takes place.
Every website has a root directory. The root of a website is the main directory that contains files and other directories. When you define a website, Dreamweaver considers that directory and all the files (or other directories) within it to be the entire universe of that particular website. If you attempt to insert an image from outside that universe, Dreamweaver prompts you to save the file inside the website.
Dreamweaver needs you to define your website so that it knows how to find files. For instance, if an image is located in an images directory within the site, Dreamweaver knows how to properly reference the image within a web page. If, however, the image is somewhere outside the defined site, Dreamweaver might not be able to reference it properly, and you might end up with bad links in your website. You learn more about how Dreamweaver links to files in Hour 5, “Adding Links: Hyperlinks, Anchors, and Mailto Links.”
You have to define a new website for every project you create. Even when projects are related, you might decide to break them down into smaller sites so that the number of files isn’t unwieldy in a single site. For instance, I create websites for a college within a major university. Rather than trying to create a single site for the entire college, I find it easier to break down the information into different sites by department. This creates more manageable chunks of information than lumping everything together. Regardless of the size of your site, you can have only a single site open in Dreamweaver at once.
To begin defining a website, open the Manage Sites dialog box by selecting Site, Manage Sites, as shown in Figure 3.1.
Figure 3.1 Select the Manage Sites menu to define a new site in Dreamweaver.
The Manage Sites dialog box, shown in Figure 3.2, is where you can create, edit, duplicate, remove, export, and import Dreamweaver site definitions. The title says it all: This is where you manage your websites! To begin defining a new site, click the New button in the Manage Sites dialog box and choose Site. The Site Definition dialog box appears.
Figure 3.2 The Manage Sites dialog box lists all the websites you have defined and enables you to manage them.
The Site Definition dialog box is where you name your site and point Dreamweaver to where the files are stored on your computer. You can define a site even if you don’t have any files; you simply define the site in an empty directory that is ready to hold all the web pages you create.