Accessibility
Adobe
Sign in My orders My Adobe

Title

How to use the Dreamweaver Site window and Template features in creating a siteProducts affected

Contents

Defining a local site
Building the site map in the Site Window

Creating a subdirectory and files

Creating the template
Saving the template and establishing editable regions

Applying the template to the pages

Testing and viewing the site

This TechNote demonstrates how to use Dreamweaver's templates and Site window to create a Web site.

Defining a local site
Before creating pages for a site, it is necessary to define the site in Dreamweaver. This is done by selecting a folder on the computer's hard disk in which all the files for the site will be contained. This is the local root folder. If you do not have a preexisting folder to select to be the local root folder, see Creating a folder below. If you already have a folder, skip to Selecting the folder below.

After the site is defined, the pages for the site are created in Dreamweaver, saved inside the local root folder, and then uploaded to the Web server. The local site and the remote site on the server should have exactly the same structure. If Dreamweaver is used to upload the site, it automatically replicates the file structure of the local root folder on the server.

Creating a folder
To create a folder on your hard disk for the local root folder,follow the steps below.

Windows:
1

On your desktop, double-click My Computer and the drive where you want the new site folder to be created;

or

Choose Start > Programs > Windows Explorer and click the drive where you want the new site folder to be created.

2 Choose File > New > Folder. The new folder appears with a temporary name.
3 Select the new folder, type a new name, then press Enter.
Macintosh:
1

On your desktop, double-click Macintosh HD and choose File > New Folder.

2 Choose File > New Folder.
3 Select the new folder, enter a name, then press Return.

Selecting the folder
To define the folder as the local root folder in Dreamweaver, do the following:

1 Choose Site > Define Sites in the Document window.
2 In the Define Sites dialog box, select New.
3 With the Local Info category selected, enter a name for the site in the Site Name field. The site name appears in the Site window and on the Site > Open Site submenu.
4 In the Local Root Folder field, click the folder icon to browse to and select the folder where the site files, templates, and library items will be stored.
5

For the Refresh Local File List Automatically option, indicate whether or not to automatically refresh the local file list every time files are copied into the local site. Deselecting this option improves the speed of Dreamweaver when copying files, but does not automatically update the list of local files that appears in your Site Files window. If you are not sure, leave this option checked.

6 In the HTTP Address field, enter the URL that the completed Web site will use, so that Dreamweaver can verify links within the site that use absolute URLs. For example, the HTTP address for Macromedia's Web site is http://www.macromedia.com.
7

For the Cache option, indicate whether or not to create a local cache to improve the speed of link and site management tasks. If this option is not selected, Dreamweaver will provide a prompt asking whether a cache should be created before the site is created. If you are not sure, leave this option checked.

8 Click OK.

The information for the other categories can be filled out later. Once the basic site definition has been established, new HTML documents can be created.

Back to top

Building the site mapin the Site window
Now that the site has been defined, the Site window appears. The Site window provides two visual representations of the local site: Site Map and Site Files. The Site window can be used to add new files to the site; to add, remove, and change links. It can also be used to create an image file of the site that can be exported to and printed from an image editing application.A home page needs to be created and defined in orderto build the site mapthat appears on the left side of the Site window.

Create a home page for the site as follows:
1 Select the local root folder.
2 Choose File> New File (Windows) or Site > Site Files View > New File (Macintosh).
3 A file titled untitled.html should appear on the right side of the Site window in Site Files.
4 Select untitled.html.
5 Choose File> Rename (Windows) or Site > Rename (Macintosh).
6 Name the file index.html

Define the home page for the site as follows:
1 Choose Site> Set As Home Page (Windows) or Site > Site Map View > Set As Home Page (Macintosh).
2 Click the Site Map icon in the top left area of the Site window.
3 The site map should now appear.

Back to top

Creating a subdirectory and files
The home page currently has no links. After links have been established, the home page and the linked pages will be displayed in the site map.

Create a subdirectory and two dependent documents as follows:
1 Select the local root folder in the Site window.
2 Choose File > New Folder (Windows) or Site > Site Files View > New Folder (Macintosh).
3 Name the subdirectory Pages.
4 Create two files to put into the Pages subdirectory by selecting the subdirectory and choosing File > New File (Windows) or Site > Site Files View > New File (Macintosh).
5

Name the files Products.html and Services.html.

Note: The template will be applied to these files in the following steps.

Back to top

Creating the template
Templates allow a designer to construct a site that has a consistent style and is easy to update. Templates are convenient for a team of designers, allowing some members of the team to concentrate on the style of the pages, while other members of the team create new pages and revise the content without altering the formatted layout. Changes can be made to the overall design of the site quickly by revising the template files directly.

Create the template as follows:
1 In the Site window, choose File > New Window.
2

Choose Modify > Page Properties. Title the future template. Set the future template's background, text, links colors, left and top margin, and margin width and height.

Note:Any HTML document can be saved as a template.

3

For the purpose of this demonstration, insert a two row, two column table in the future template.

The first row is reserved for the page banner and will be an editable region.

The second row of the first column is where the navigation bar will be built. This row will be an uneditable region.

The second row of the second column is where the future content will be placed.

The navigation bar:
Most Web sites have a navigation bar that provides links to the individual Web pages of the site. Usually, the navigation bar is inserted into the uneditable region of the template. This method ensures it is easily applied to each page created from the template and is updated by simply editing the template.

Note:To build a more sophisticated navigation bar, simply follow the instructions for Creating a graphical navigation bar in Fireworks or Creating an animated navigation bar in Flash in the Navigation bar overview article.

Build a simple text-only navigation bar as follows:

1

In the second row of the first column, insert a one column, seven row table.

2

In the first row of this embedded table, type HOME. In the third row, type PRODUCTS. In the fifth row, type SERVICES. In the seventh row, type CONTACT.

3 With the cursor in a cell, the Property inspector displays the cell properties, such as background color (Bg), width (W), height (H), and text alignment (Horz/Vert). Apply the desired properties to each cell.
4 To link to index.html, products.html, and services.html, select the text in the cell, click the Folder icon in the Link field of the Property inspector, browse to the appropriate file, and select the file. Repeat this process for each cell.
5 For the Contact link, simply select the CONTACT text and, in the Link field of the Property inspector, type in mailto:youremailaddress. When a visitor to the site selects that link, their e-mail program opens and an e-mail with your address in the To: field becomes available.

Back to top

Saving the template and establishing editable regions
Once the design of the future template is complete, it must be saved as a DWT file (template) in order to be able to establish editable or noneditable regions. Originally, each template has only locked regions. Locked regions can be edited only inside the template itself. Editable regions are placeholders for the content that is unique to each page to which the template is applied. The content of editable regions is created and edited in the document that is derived from the template.

Establish editable regions in the template as follows:
1

Select File > Save as Template to generate the DWT file.

2 Dreamweaver creates a Templates folder. The template will automatically be placed in this folder when it is saved.
3 With the cursor in the first row, select Modify > Templates > New Editable Region. The New Editable Region dialog box appears.
4 In the Name field, type Banner Editable Region as the name for this region of the template. This editable region will be used as a placeholder for the title of the site pages. Click OK. In the Document window, the region is highlighted and identifiable by the region name.
5 With the cursor in the empty cell next to the navigation bar (the second row of the second column), select Modify > Templates > New Editable Region. The New Editable Region dialog box appears.
6 In the Name field, type Body Editable Region as the name for this region of the template. This editable region will be used as a placeholder for the text of the site pages. Click OK. In the Document window, the region is highlighted and identifiable by the region name.
7 When the Update Pages dialog box appears, select "No". Then click Close.

Note:Make sure not to move the DWT file from the Templates folder. Also, do not rename or move the Templates folder. As long as the DWT file remains inside the Templates folder, the links from the pages derived from the template to the template will not be broken.

Back to top

Applying the template to the pages
The new template is ready to apply to the index, products and services pages. In an applied template, the editable regions are highlighted. They appear in a highlight color on all pages to which the template is applied as well.

Apply the template to the pages as follows:
1 Select File > Open.
2 Browse to and select index.html.
3 Select Modify > Templates > Apply Template to Page.
4 Type the title of the page in the Banner Editable Region. Type or insert text in the Body Editable Region.
5 Select File > Save. Repeat the above steps for the products and services pages.

Back to top

Testing and viewing the site
You are now ready to test and view the site:

1 In the Document window, select File > Open.
2 Browse to and select index.html.
3 Select F12 to preview in the browser.
4 Click the navigation bar links to navigate from page to page.

Back to top




Doc ID
(tn_14567)

Last updated
2007-06-05

Products affected

Contacting Adobe Support

Still need help?
Find out about all your support options.
Contact support