Inserting Repeating Regions


A repeating region is an area on the page that needs to be duplicated one or more times. Repeating regions can be particularly useful when you need to have multiple entries, possibly a varying number, placed on pages built from your templates. For example, if a template is created for food recipes and each page based on the template covers a different recipe, the list of ingredients varies on each page. If the list items are defined as repeating regions, you can then add as many of those regions as necessary to each individual page. Repeating regions allow you to have specific control over the appearance of multiple entries. In this exercise, the table listing customer quotes will use repeating regions.

1.

In the teacher.dwt document, use the tag selector to select <tr> for the table row that contains the placeholder text for teacher certifications.

Outlines appear around the row to indicate that it is selected.

2.

Choose Repeating Region from the Templates menu on the Insert bar.

The New Repeating Region dialog box opens.

3.

Name the region certs and then click OK.

The row you selected becomes outlined in a light blue color, and a tab at the top of the outline displays the name "certs." The highlight color for repeating regions is the same as the highlight color for optional regions and is lighter than the color for editable regions.

Note

When developing your own Websites, you might want to change the color of the highlighted regions if they don't show up against the colors used in your page. Choose Dreamweaver > Preferences (Macintosh) or Edit > Preferences (Windows) and select the Highlighting category. Click the Editable regions color box and select a highlight color or enter the hexadecimal value directly into the text field. Do the same as needed for the other highlight colors. The editable region color appears in the template itself and in documents based on the template; the locked region color appears only in documents based on the template. The default colors are blue (#66CCCC) for editable regions and pale yellow (#FFFFCC) for locked regions. You can click the Show boxes to enable or disable the display of these colors in the Document window. These highlight colors show in the Document window only if the option to view invisible elements is enabled. If invisible elements such as the highlighting on template regions do not appear in the Document window, choose View > Visual Aids > Invisible Elements and check that the Show boxes are checked for the template visual aid elements in the Highlighting category in the preferences. If template-based pages are being built by a number of people on your team, remember that other team members can use the default color settings.

4.

Select the <td> on the tag selector for the table cell that contains the placeholder certification date: xx/xx/xxxx. Choose Editable Region from the Templates menu on the Insert bar and type certDate for the region name.

Multiple table cells can't be designated as a single editable region. If you need multiple cells to be editable, you must either make the entire table editable or break it up into several editable regions. If you try to select multiple cells within a table and make them editable, the whole table becomes an editable region.

5.

Select the <td> on the tag selector for the table cell that contains the placeholder name of certification. Click the Editable Region button on the Insert bar and type certName for the region name.

Tip

In addition to clicking the corresponding <td> tag on the tag selector, you can also select a cell easily by placing the pointer in the cell and use the keyboard shortcut Cmd+click (Macintosh) or Ctrl+click (Windows).


To make changes within a repeating region in any subsequent documents that are based on your teacher template, the repeating region must contain as many editable regions as necessary. Repeating regions are locked by default; you must define which areas inside of the repeating region need to be made editable.

Note

If it is difficult to see the outline or tab indicating an editable region; you can confirm that the cell you made editable is indeed an editable region by clicking inside the cell and looking at the tag selector. The highlighted <td> tag corresponds to the cell you clicked in. Following that <td> tag is the template markup <mmtemplate:editable>.


Your document should look like the example shown here.

You should save and close the teacher.dwt file.




Macromedia Dreamweaver 8(c) Training from the Source
Macromedia Dreamweaver 8: Training from the Source
ISBN: 0321336267
EAN: 2147483647
Year: 2006
Pages: 326

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net