Considering Site Organization
There are many opinions about the proper way to organize a Web site. Some people like to compartmentalize all the files into directories and subdirectories. Some people like to have a very shallow structure, with many files in a single directory. As you get more experienced at Web development, you'll find your ideal organization. It's nice to exchange ideas with other Web developers or hobbyists so that you can learn from the successes and failures of others and they can learn from yours.
I have a directory on my hard drive called Projects, represented in Figure 3.13. The Projects directory contains a directory for each project I'm working on. Within each project directory there is a directory called Web. This is the directory where I keep all the development files for the site and the directory that I set as the root in Dreamweaver.
Figure 3.13 An example of a directory structure in which the Web site is housed in the Web directory.
This directory structure enables me to put other files, such as correspondence, contracts, invoices, and spreadsheets, in the client's folder without making them part of the Web site. It's good practice to keep other files separate from those you plan to transfer to the Web. You might prefer to have one directory that contains all your Web sites. Do whatever works best for you.
Put some thought into how you'll organize the files in your Web site before you start a project. You will probably want to create a separate images folder to hold your images, as shown in Figure 3.14. If you have other types of assets, such as sound or video, you might want to create separate folders for those, too. I always create a scripts directory to hold external JavaScript files and external Cascading Style Sheets files; you'll explore these in the later hours of this book.
Figure 3.14 You can organize your Web site into images and other directories.
I try to logically break up sections of Web sites into separate directories. If your Web site has obvious divisions (departments, lessons, products, and so on), you can create directories to hold the Web pages in each of the sections. You'll be surprised at how even a small Web site becomes quickly unmanageable when all the files are dumped into one directory.
Most Web sites use many image files. If you have different sections in your Web site, do you want to have separate images directories in each section? It might be a good way to organize your site. Then again, if images are used across multiple sections, it might make the images hard to find. Make sure that your organizational logic isn't going to break down as you add files to your site.
Luckily, if you do have to rearrange assets, Dreamweaver will update any links for you. When you move a file, Dreamweaver asks you if you want to search and update links to that file. That's what the site cache is created for. However, it is still best to make wise design decisions at the beginning of a big project.