Dreamweaver MX 2004 Templates
Table f Cntents Dreamweaver Templates... 3 Creating a Dreamweaver template... 3 Types f template regins... 4 Inserting an editable regin... 4 Selecting editable regins... 5 Remving an editable regin... 6 Creating repeating regins... 6 Creating a repeating regin in a template... 7 Inserting a repeating table... 8 Inserting an ptinal regin... 8 Setting the ptinal regin dialg bx ptins... 10 Mdifying an ptinal regin... 11 Mdifying template prperties... 11 Defining editable tag attributes... 12 Specifying editable tag attributes in a template... 12 Mdifying template prperties... 13 Creating a dcument based n a template... 14 Excerpted frm Dreamweaver MX 2004 Help Page 2 f 14 Cpyright 1997-2003 Macrmedia, Inc.
Dreamweaver Templates A template authr designs a "fixed" page layut in a template. The authr then creates regins in the template that are editable in dcuments based n that template; if the authr des nt define a regin as editable, then template users cannt edit cntent in that area. Templates enable template authrs t cntrl which page elements template users--such as writers, graphic artists, r ther web develpers--can edit. There are several types f template regins the template authr can include in a dcument. One f the mst pwerful uses f templates is the ability t update multiple pages at nce. A dcument that is created frm a template remains cnnected t that template (unless yu detach the dcument later). Yu can mdify a template and immediately update the design in all dcuments based n it. Creating a Dreamweaver template Yu can create a template frm an existing web page, r yu can create a template frm a new, blank dcument. After yu create the template, yu can insert template regins. Dreamweaver saves template file in the site s Templates flder in the lcal rt flder f the site, with a.dwt filename extensin. If the Templates flder des nt already exist in the site, Dreamweaver autmatically creates it when yu save a new template. T use the Assets panel t create a new template 1. In the Assets panel (Windw > Assets), select the Templates categry n the left side f the panel. The Templates categry f the Assets panel appears. 2. Click the New Template buttn at the bttm f the Assets panel. A new, untitled template is added t the list f templates in the Assets panel. 3. While the template is still selected, enter a name fr the template, then press Enter (Windws) r Return (Macintsh). Dreamweaver creates a new blank template in the Assets panel and in the Templates flder. Excerpted frm Dreamweaver MX 2004 Help Page 3 f 14 Cpyright 1997-2003 Macrmedia, Inc.
Types f template regins Dreamweaver autmatically lcks mst regins f a dcument when yu save the dcument as a template. As a template authr yu specify which regins f a template-based dcument will be editable by inserting editable regins r editable parameters in the template. As yu create the template, yu can make changes t bth editable and lcked regins. In a dcument based n the template, hwever, a template user can make changes nly in the editable regins; the lcked regins can t be mdified. There are fur types f template regins: An editable regin is an unlcked regin in a template-based dcument--a sectin a template user can edit. A template authr can specify any area f a template as editable. Fr a template t be effective it shuld cntain at least ne editable regin; therwise, pages based n the template can t be edited. A repeating regin is a sectin f the layut in a dcument that is set t repeat. Fr example, yu can set a table rw t repeat. Usually repeating sectins are editable s that the template user can edit the cntent in the repeating element, while the design itself is under the cntrl f the template authr. The template user uses repeat regin cntrl ptins t add r delete cpies f the repeated regin in a dcument based n the template as necessary. There are tw types f repeating regins yu can insert in a template: repeating regin and repeating table. An ptinal regin is a sectin f a template that yu specify as ptinal, t hld cntent such as ptinal text r an image that may r may nt appear in a dcument based n the template. In the template-based page, the template user usually cntrls whether the cntent is displayed. An editable tag attribute lets yu unlck a tag attribute in a template, s the attribute can be edited in a template-based page. Fr example, yu can "lck" which image appears in the dcument but let the template user set the alignment t left, right, r center. Inserting an editable regin Befre yu insert an editable regin, yu shuld save the dcument yu are wrking in as a template. Nte: If yu insert an editable regin in a dcument rather than a template file, Dreamweaver warns yu that the dcument will autmatically be saved as a template. Excerpted frm Dreamweaver MX 2004 Help Page 4 f 14 Cpyright 1997-2003 Macrmedia, Inc.
T insert an editable template regin: 1. In the Dcument windw, d ne f the fllwing t select the regin: Select the text r cntent that yu want t set as an editable regin. Place the insertin pint where yu want t insert an editable regin. 2. D ne f the fllwing t insert an editable regin: Select Insert > Template Objects > Editable Regin. Right-click (Windws) r Cntrl-click (Macintsh), then select Templates > New Editable Regin. In the Cmmn categry f the Insert bar, click the arrw n the Templates buttn, then select Editable Regin. 3. The Editable Regin dialg bx appears. 4. In the Name text bx, enter a unique name fr the regin. (Yu cannt use the same name fr mre than ne editable regin in a particular template.) Nte: D nt use special characters in the Name text bx. 5. Click OK. The editable regin is enclsed in a highlighted rectangular utline in the template, using the highlighting clr that is set in preferences. A tab at the upper left crner f the regin shws the name f the regin. If yu insert an empty editable regin in the dcument, the name f the regin als appears inside the regin. Selecting editable regins Yu can easily identify and select template regins in bth the template dcument and templatebased dcuments. T select an editable regin in the Dcument windw: Click the tab in the upper left crner f the editable regin. Excerpted frm Dreamweaver MX 2004 Help Page 5 f 14 Cpyright 1997-2003 Macrmedia, Inc.
T find an editable regin and select it in the dcument: Select Mdify > Templates, then select the name f the regin frm the list at the bttm f that submenu. Nte: Editable regins that are inside a repeated regin d nt appear in the menu. Yu must lcate these regins by lking fr tabbed brders in the Dcument windw. The editable regin is selected in the dcument. Remving an editable regin If yu ve marked a regin f yur template file as editable and yu want t lck it (make it nneditable in template-based dcuments) again, use the Remve Template Markup cmmand. T remve an editable regin: 1. Click the tab in the upper left crner f the editable regin t select it. 2. D ne f the fllwing: Select Mdify > Templates > Remve Template Markup. Right-click (Windws) r Cntrl-click (Macintsh), then select Templates > Remve Template Markup. The regin is nw n lnger editable. Creating repeating regins A repeating regin is a sectin f a template that can be duplicated as ften as desired in a template-based page. Yu typically use repeating regins with tables; hwever, yu can define a repeating regin fr ther page elements as well. Repeating regins enable yu t cntrl yur page layut by repeating certain items, such as a catalg item and descriptin layut, r a rw fr data such as a list f items. There are tw repeating regin template bjects yu can use: repeating regin and repeating table. Excerpted frm Dreamweaver MX 2004 Help Page 6 f 14 Cpyright 1997-2003 Macrmedia, Inc.
Creating a repeating regin in a template Repeating regins enable template users t duplicate a specified regin in a template as ften as desired. A repeating regin is nt an editable regin. T make cntent in a repeating regin editable (fr example, t allw a user t enter text in a table cell in a template-based dcument), yu must insert an editable regin in the repeating regin. T insert a repeating regin in a template: 1. In the Dcument windw, d ne f the fllwing: Select the text r cntent yu want t set as a repeating regin. Place the insertin pint in the dcument where yu want t insert the repeating regin. 2. D ne f the fllwing, t create a repeating regin: Select Insert > Template Objects > Repeating Regin. Right-click (Windws) r Cntrl-click (Macintsh), then select Templates > New Repeating Regin. In the Cmmn categry f the Insert bar, click the arrw n the Templates buttn, then select Repeating Regin. 3. The New Repeating Regin dialg bx appears. 4. In the Name text bx, enter a unique name fr the template regin. (Yu cannt use the same name fr mre than ne repeating regin in a template.) Nte: When yu name a regin, d nt use special characters. 5. Click OK. The repeating regin is inserted in the template. Nte: A repeating regin isn t editable in the template-based dcument, unless it cntains an editable regin. Excerpted frm Dreamweaver MX 2004 Help Page 7 f 14 Cpyright 1997-2003 Macrmedia, Inc.
Inserting a repeating table Yu can use a repeating table t create an editable regin (in table frmat) with repeating rws. Yu can define table attributes and set which table cells are editable. T insert a repeating table: 1. In the Dcument windw, place the insertin pint in the dcument where yu want t insert the repeating table. 2. D ne f the fllwing: Select Insert > Template Objects > Repeating Table. In the Cmmn categry f the Insert bar, click the arrw n the Templates buttn, then select Repeating Table. 3. The Insert Repeating Table dialg bx appears. 4. Enter new values as desired. 5. Click OK. The repeating table appears in the template. Inserting an ptinal regin Use an ptinal regin t cntrl cntent which may r may nt be shwn in a template-based dcument. There are tw ptinal regin bjects: An ptinal regin enables template users t shw and hide specially marked regins withut enabling them t edit the cntent. The template tab f an ptinal regin is preceded by the wrd if. Based n the cnditin set in the template, a template user can define whether the regin is viewable in pages they create. An editable ptinal regin enables template users t set whether the regin shws r hides and enables them t edit cntent in the regin. Excerpted frm Dreamweaver MX 2004 Help Page 8 f 14 Cpyright 1997-2003 Macrmedia, Inc.
Fr example, if the ptinal regin includes an image r text, the template user can set whether the cntent is displayed, as well as make edits t the cntent if desired. An editable regin is cntrlled by a cnditinal statement. T insert an ptinal regin: 1. In the Dcument windw, select the element yu want t set as an ptinal regin. 2. D ne f the fllwing: Select Insert > Template Objects > Optinal Regin. Right-click (Windws) r Cntrl-click (Macintsh) the selected cntent, then select Templates > New Optinal Regin. In the Cmmn categry f the Insert bar, click the arrw n the Templates buttn, then select Optinal Regin. 3. The Optinal Regin dialg bx appears. 4. Specify ptins fr the ptinal regin. 5. Click OK. T insert an editable ptinal regin: 1. In the Dcument windw, place the insertin pint where yu want t insert the ptinal regin. Tip: Yu cannt wrap a selectin t create an editable ptinal regin. Insert the regin, then insert the cntent in the regin. 2. D ne f the fllwing t pen the Optinal Regin dialg bx: Select Insert > Template Objects > Editable Optinal Regin. In the Cmmn categry f the Insert bar, click the arrw n the Templates buttn, then select Editable Optinal Regin. 3. The Optinal Regin dialg bx appears. 4. Enter a name fr the ptinal regin, then click the Advanced tab if yu want t set ther ptins. 5. Click OK. Excerpted frm Dreamweaver MX 2004 Help Page 9 f 14 Cpyright 1997-2003 Macrmedia, Inc.
Setting the ptinal regin dialg bx ptins The purpse f this dialg bx is t create template parameters and t define cnditinal statements (If...else statements) fr template regins. Yu can use simple true/false peratins, r define mre cmplex cnditinal statements and expressins. In the Advanced tab yu can link multiple ptinal regins t a named parameter. In the template-based dcument, bth regins will shw r hide as a unit. Fr example, yu can shw a "clseut" image and sales price text area fr a sale item. Yu can als use the Advanced tab t write a template expressin that evaluates a value fr the ptinal regin and shws it r hides it based n the value. T cmplete the Optinal Regin dialg bx: 1. In the Basics tab, enter a name fr the parameter in the Name text bx. 2. Select the Shw By Default checkbx t set the selected regin t shw in the dcument. Deselect it t set the default value t false. Nte: T set a different value fr the parameter, in Cde view lcate the parameter in the head sectin f the dcument and edit the value. 3. (Optinal) Click the Advanced tab, then set the fllwing ptins: 4. Click OK. If yu want t link ptinal regin parameters, click the Advanced tab, select Use Parameter, then frm the pp-up menu select the existing parameter yu want t link the selected cntent t. If yu want t write a template expressin t cntrl the display f an ptinal regin, click the Advanced tab, select Enter Expressin, then enter the expressin in the text bx. Nte: Dreamweaver autmatically inserts duble-qutatin marks arund the text yu enter. When yu use the Optinal Regin template bject, Dreamweaver inserts template cmments in the cde. A template parameter is defined in the head sectin, as in the fllwing example: <!-- TemplateParam name="departmentimage" type="blean" value="true" --> At the lcatin where the ptinal regin is inserted, cde similar t the cde belw appears: <!-- TemplateBeginIf cnd="departmentimage" --> <p><img src="/images/airfare_n.gif" width="85" height="22"> </p> <!-- TemplateEndIf --> Excerpted frm Dreamweaver MX 2004 Help Page 10 f 14 Cpyright 1997-2003 Macrmedia, Inc.
Mdifying an ptinal regin Yu can edit ptinal regin settings after yu ve inserted the regin in a template. Fr example, yu can change whether the default fr the cntent is set t shw r nt, link a parameter t an existing ptinal regin, r mdify a template expressin. T repen the Optinal Regin dialg bx: 1. In the Dcument windw, d ne f the fllwing: In Design view, click the template tab f the ptinal regin yu want t mdify. In Design view, place the insertin pint in the template regin; then in the tag selectr at the bttm f the Dcument windw, select the template tag, <mmtemplate:if>. In Cde view, click the cmment tag f the template regin yu want t mdify. 2. In the Prperty inspectr (Windw > Prperties), click Edit. The Optinal Regin dialg bx appears. 3. Make changes as necessary.. 4. Click OK. Mdifying template prperties When template authrs create parameters in a template, dcuments based n the template autmatically inherit the parameters and their initial value settings. A template user can update editable tag attributes and ther template parameters (such as ptinal regin settings). T mdify an editable tag attribute: 1. Open the template-based dcument. 2. Select Mdify > Template Prperties. The Template Prperties dialg bx pens, shwing a list f available prperties. The dialg bx shws ptinal regins and editable tag attributes. 3. In the Name list, select the prperty. The bttm area f the dialg bx updates t shw the selected prperty s label and its assigned value. 4. In the field t the right f the prperty label, edit the value t mdify the prperty in the dcument. Excerpted frm Dreamweaver MX 2004 Help Page 11 f 14 Cpyright 1997-2003 Macrmedia, Inc.
Nte: The field name and updateable values are defined in the template. Attributes that d nt appear in the Name list are nt updateable in the template-based dcument. 5. Select the Allw Nested Templates t Cntrl This checkbx, if yu want t pass the editable prperty alng t a dcuments based n the nested template. T mdify ptinal regin template parameters: 1. Open the template-based dcument. 2. Select Mdify > Template Prperties. The Template Prperties dialg bx pens, shwing a list f available prperties. The dialg bx shws ptinal regins and editable tag attributes. 3. In the Name list, select a prperty. The dialg bx updates t shw the selected prperty s label and its assigned value. 4. Select the Shw checkbx, t shw the ptinal regin in the dcument, r deselect the checkbx t hide it. Nte: The field name and default setting are defined in the template,. 5. Select the Allw Nested Templates t Cntrl This checkbx, if yu want t pass the editable prperty alng t a dcuments based n the nested template. Defining editable tag attributes Yu can enable a template user t mdify specified tag attributes in a dcument created frm a template. Fr example, yu can set a backgrund clr in the template dcument, yet enable template users t set a different backgrund clr fr pages they create. Users can update nly the attributes yu specify as editable. Specifying editable tag attributes in a template Yu can set multiple editable attributes in a page s that template users can mdify the attributes in template-based dcuments. The fllwing data types are supprted: text, Blean (true/false), clr, and URL. Excerpted frm Dreamweaver MX 2004 Help Page 12 f 14 Cpyright 1997-2003 Macrmedia, Inc.
T define an editable tag attribute: 1. In the Dcument windw, select an item yu want t set an editable tag attribute fr. 2. Select Mdify > Templates > Make Attribute Editable. The Editable Tag Attributes dialg bx appears. Cmplete the dialg bx fr each attribute yu want t make editable. 3. Click OK. Creating an editable tag attribute inserts a template parameter in the cde. An initial value fr the attribute is set in the template dcument; when a template-based dcument is created, it inherits the parameter. A template user can then edit the parameter in the template-based dcument Mdifying template prperties When template authrs create parameters in a template, dcuments based n the template autmatically inherit the parameters and their initial value settings. A template user can update editable tag attributes and ther template parameters (such as ptinal regin settings). T mdify an editable tag attribute: 1. Open the template-based dcument. 2. Select Mdify > Template Prperties. The Template Prperties dialg bx pens, shwing a list f available prperties. The dialg bx shws ptinal regins and editable tag attributes. 3. In the Name list, select the prperty. The bttm area f the dialg bx updates t shw the selected prperty s label and its assigned value. 4. In the field t the right f the prperty label, edit the value t mdify the prperty in the dcument. Nte: The field name and updateable values are defined in the template. Attributes that d nt appear in the Name list are nt updateable in the template-based dcument. 5. Select the Allw Nested Templates t Cntrl This checkbx, if yu want t pass the editable prperty alng t a dcuments based n the nested template. T mdify ptinal regin template parameters: 1. Open the template-based dcument. 2. Select Mdify > Template Prperties. Excerpted frm Dreamweaver MX 2004 Help Page 13 f 14 Cpyright 1997-2003 Macrmedia, Inc.
The Template Prperties dialg bx pens, shwing a list f available prperties. The dialg bx shws ptinal regins and editable tag attributes. 3. In the Name list, select a prperty. The dialg bx updates t shw the selected prperty s label and its assigned value. 4. Select the Shw checkbx, t shw the ptinal regin in the dcument, r deselect the checkbx t hide it. Nte: The field name and default setting are defined in the template,. 5. Select the Allw Nested Templates t Cntrl This checkbx, if yu want t pass the editable prperty alng t a dcuments based n the nested template. Creating a dcument based n a template Yu can use the New Dcument dialg bx t select a template frm any f yur Dreamweaverdefined sites r yu can use the Assets panel t create a new dcument frm an existing template. T create a new dcument based n a template: 1. Select File > New. The New Dcument dialg bx pens. 2. Click the Templates tab. In the Templates Fr list, select the Dreamweaver site that cntains the template yu want use, then select a template frm the list n the right. 3. Click Create. The new dcument pens in the Dcument windw. 4. Save the dcument. T create a new dcument frm a template in the Assets panel: Open the Assets panel (Windw > Assets), if it is nt already pen. 1. In the Assets panel, click the Templates icn n the left t view the list f templates in yur current site. Tip: If yu just created the template yu want t apply, yu might need t click the Refresh buttn t see it. 2. Right-click (Windws) r Cntrl-click (Macintsh) the template yu want t apply, then select New Frm Template. The dcument pens in the Dcument windw. Excerpted frm Dreamweaver MX 2004 Help Page 14 f 14 Cpyright 1997-2003 Macrmedia, Inc.