Generate the CSS menu in the Dreamweaver template

As said earlier, before building (adding content in) the site pages, you need to create a template file in Dreamweaver that will include the site menu. By attaching the template to the site files, you will make sure that the menu shows in each site page.

To create the Dreamweaver template, follow the instructions below:

  1. From the File menu in Dreamweaver, choose the first option, namely New (or press Ctrl+N in your site). A dialog box with two tabs will pop-up. You only need to set some options in the first tab (General):


                                              

  2. Before starting to add content in the template, press Ctrl+S to save the file in your site structure. Since there is no editable region in your template file yet, you will be asked for confirmation first if you really want to save the file. Click OK as you will add the editable region below.
    In the new dialog box that opens enter the name by which you want to save the template file - html_tmp, and click the Save button:


                                              
    Notice in the Files tab of the Files panel the Templates folder automatically generated by Dreamweaver, and the template file you just created located inside this folder.

  3. It is now time to add the site CSS menu. Apply the CSS Menu Wizard from the InterAKT tab of the Insert bar. The wizard has three steps.

  4. Configure the first step of the wizard as shown below:


                                              

  5. In the second step of the wizard you get to enter the items of the site CSS menu. Start with the first-level items (Home, Products, Company), and then continue with the sub-items for the Products item. Configure the user interface as shown below:


                                         

  6. Configure the third step of the wizard as shown below:


                                              

  7. After adding the menu in page, the last thing you have to do to complete the template file is to add an editable region. In Design view, click inside the menu translator, and select (click) the <div.horizontal#cssMenu1> tag in the Tag Selector. Press the right arrow key and then Enter to create a new paragraph below the menu <div>. This is where you will insert the editable region where the content of each template-based site page will be entered.
    From the Insert menu in Dreamweaver, select the Templates Objects -> Editable Region option:


                                              
    In the dialog box that pops-up enter a name for the editable region - HTML content, and then click the OK button:

 

After following the steps above, the html_tmp.dwt page in Dreamweaver, in Design view, should look like this:

 

Notice that nothing was added in the Server Behaviors tab of the Application panel. If you want to edit the menu later on, click inside its translator and use the corresponding Property Inspector.

Note: If you later on make changes in the template file, they will become visible (after refreshing) in the template-based pages.

Save the html_tmp.dwt file and upload it to the server. You can preview it in browser (press F12) if you want to, but the pages to which menu items point are empty right now (no content and no template attached).

Continue with the next topic to build the actual site pages based on this Dreamweaver template.