Reusing Content with Templates and Libraries > Defining a template's editable regions |
Defining a template's editable regions
In a template, editable regions are the parts of the page that can be changed in files based on the templatefor example, the text of an article in a newsletter would appear in an editable region, so that every article could contain different text. Locked (noneditable) regions are the parts of the page layout that remain constant from one page to another.
All regions in a new template are locked when you create the template, so to make the template useful, you must make some regions editable (unlock them).
While you are editing the template file itself, you can make changes to both editable and locked regions. In a document based on the template, however, you can make changes only to the editable regions of the document; the locked regions of the document can't be modified.
Note: When you name a region, you can't use the following characters: single or double quotation marks (' "), angle brackets (< >), and ampersands (&).
To define existing template content as an editable region:
1 | In the template file, select the text or content you want to change to an editable region. |
2 | Do one of the following: |
Choose Modify > Templates > New Editable Region. | |
Right-click (Windows) or Control-click (Macintosh) the selected text, and choose New Editable Region from the context menu. | |
3 | In the New Editable Region dialog box, enter a unique name for the region. (You cannot use the same name for more than one editable region in a particular template.) |
The editable region is enclosed in a highlighted rectangular outline in the template, using the highlighting color set in preferences. See Template preferences. A tab at the upper left corner of the region shows the name of the region. | |
You can mark an entire table or an individual table cell as editable; however, you can't mark multiple table cells as a single editable region. Note that Dreamweaver does not distinguish between marking a table cell as editable and marking the contents of the cell as editable. | |
Layers and layer content are separate elements; making a layer editable lets you change the position of the layer as well as its contents, while making a layer's contents editable lets you change only the content of the layer, not its position. To select the layer's content, click in the layer and choose Edit > Select All; to select the layer itself, make sure invisible elements are showing, then click the icon representing the location of the layer. For more information about layers, see Layers overview. | |
Note: If you've made a layer's contents editable, and you later want to also make its position editable, you must remove the editable region around the contents before you can mark the layer itself as editable. See Locking an editable region. | |
To insert an empty editable region in a template:
1 | In the template, place the insertion point where you want to insert an editable region. |
2 | Choose Modify > Templates > New Editable Region. |
3 | In the New Editable Region dialog box, enter a name for the region. |
The region name, surrounded by braces ({} ), is inserted into the template as a placeholder, enclosed in a rectangular outline of the appropriate highlight color. |
|
When you apply the template to a document, you can then select the braces and region name and replace them with text, images, or other content. | |