Changing the default file Customizing the interpretation of third-party tags u Customizing the Code view toolbar Customizing default documents The Document Types/New Documents folder contains a default(blank) document of each type that you can create using Dreamweaver. When you create a new blank document by selecting File New and selecting an item from the Basic Page, Dynamic Page, or Other categories, Dreamweaver bases the new document on the appropriate default document in this folder. To change what appears in a default document of a given type, edit the appropriate document in this folder 3 f you want all the pages in your site to contain common elements(such as a copyright notice)or a common layout, it's better to use templates and library items than to change the default documents. For more information about templates and library items, see Using Dreamweaver Customizing page designs Dreamweaver provides a variety of predesigned cascading style sheets, framesets, and page designs. You can create pages based on these designs by selecting File > New To customize the available designs, edit the files in BuiltIn/css, BuiltIn/framesets, BuiltIn/ Templates, and BuiltIn/Templates Accessible folders The designs listed in the Page Designs and Page Designs(Accessible)categories are Dreamweaver template files; for more information on templates, see Using You can also create custom page designs by adding files to the subfolders of the BuiltIn folder. To make a description of the file appear in the New Document dialog box, create a Design lotes file(in the appropriate_notes folder) that corresponds to the page design file 18 Customizing Dreamweaver
18 Customizing Dreamweaver ■ Changing the default file type ■ Customizing the interpretation of third-party tags ■ Customizing workspace layouts ■ Customizing the Code view toolbar Customizing default documents The DocumentTypes/NewDocuments folder contains a default (blank) document of each type that you can create using Dreamweaver. When you create a new blank document by selecting File > New and selecting an item from the Basic Page, Dynamic Page, or Other categories, Dreamweaver bases the new document on the appropriate default document in this folder. To change what appears in a default document of a given type, edit the appropriate document in this folder. Customizing page designs Dreamweaver provides a variety of predesigned cascading style sheets, framesets, and page designs. You can create pages based on these designs by selecting File > New. To customize the available designs, edit the files in BuiltIn/css, BuiltIn/framesets, BuiltIn/ Templates, and BuiltIn/TemplatesAccessible folders. You can also create custom page designs by adding files to the subfolders of the BuiltIn folder. To make a description of the file appear in the New Document dialog box, create a Design Notes file (in the appropriate _notes folder) that corresponds to the page design file. NOTE If you want all the pages in your site to contain common elements (such as a copyright notice) or a common layout, it’s better to use templates and library items than to change the default documents. For more information about templates and library items, see Using Dreamweaver). NOTE The designs listed in the Page Designs and Page Designs (Accessible) categories are Dreamweaver template files; for more information on templates, see Using Dreamweaver)
Customizing the appearance of dialog boxes The dialog box layouts for objects, commands, and behaviors are specified as HTML forms; they reside in HTML files in the Configuration folder within the Dreamweaver application folder. You edit these forms as you would edit any form in Dreamweaver. For more information, see Using Dreamweaver files in your user Configuration folder rather than editing Dreamweaver configuration on z Remember that in a multiuser operating system, you should edit copies of configuration files. For more information, see "Multiuser Configuration folders "on page 104 To change the appearance of a dialog box 1. In Dreamweaver, select Edit>Preferences, and then select the Code rewriting category 2. Unselect the Rename Form Items when Pasting option Unselecting this option ensures that form items retain their original when you copy 3. Click OK to close the Preferences dialog box. 4. On your disk, find the appropriate HTM file in the Configuration/Objec Configuration/ Commands, or Configuration/ Behaviors folde 5. Make a copy of the file somewhere other than the Configuration folder 6. Open the copy in Dreamweaver, edit the form, and save it. 8. Copy the changed file back to the Configuration folder in place of the original (It's a good idea to first make a backup of the original, so you can restore it later if needed. 9. Restart Dreamweaver to see the changes You should change only the appearance of the dialog box, not how it works; it must still contain the same types of form elements with the same names, so that the information ns from the dialog box can still be used in the he same way. For example, the Comment object takes text input from a text area in a dialog box and uses a simple JavaScript function to turn that text into an HTML comment and insert the comment into your document. The form that describes the dialog box is in the Comment. htm file in the Configuration/Objects/Invisibles folder. You car of its name attribute, the Comment object does not work prop lays to customize Dreamweaver
Ways to customize Dreamweaver 19 Customizing the appearance of dialog boxes The dialog box layouts for objects, commands, and behaviors are specified as HTML forms; they reside in HTML files in the Configuration folder within the Dreamweaver application folder. You edit these forms as you would edit any form in Dreamweaver. For more information, see Using Dreamweaver. To change the appearance of a dialog box: 1. In Dreamweaver, select Edit > Preferences, and then select the Code Rewriting category. 2. Unselect the Rename Form Items when Pasting option. Unselecting this option ensures that form items retain their original names when you copy and paste them. 3. Click OK to close the Preferences dialog box. 4. On your disk, find the appropriate HTM file in the Configuration/Objects, Configuration/ Commands, or Configuration/Behaviors folder. 5. Make a copy of the file somewhere other than the Configuration folder. 6. Open the copy in Dreamweaver, edit the form, and save it. 7. Quit Dreamweaver. 8. Copy the changed file back to the Configuration folder in place of the original. (It’s a good idea to first make a backup of the original, so you can restore it later if needed.) 9. Restart Dreamweaver to see the changes. You should change only the appearance of the dialog box, not how it works; it must still contain the same types of form elements with the same names, so that the information Dreamweaver obtains from the dialog box can still be used in the same way. For example, the Comment object takes text input from a text area in a dialog box and uses a simple JavaScript function to turn that text into an HTML comment and insert the comment into your document. The form that describes the dialog box is in the Comment.htm file in the Configuration/Objects/Invisibles folder. You can open that file and change the size and other attributes of the text area, but if you remove the textarea tag entirely, or change the value of its name attribute, the Comment object does not work properly. NOTE Remember that in a multiuser operating system, you should edit copies of configuration files in your user Configuration folder rather than editing Dreamweaver configuration files. For more information, see “Multiuser Configuration folders” on page 104
Changing the default file type By default, Dreamweaver shows all the file types it recognizes in the File >Open dialog box You can use a pop-up menu in that dialog box to limit the display to certain types of files. If t of your work involves a specific file type(such as ASP files), you can change the default olay. Whatever file type is listed on the first line of the Dreamweaver Extensions. txt file 3 f you want to see all file types in the File >Open dialog box (even the files Dreamweaver ml lcan't open), you must select All Files(". ") This is different from All Documents, which er can open To change the Dreamweaver default File > Open file type 1. Make a backup copy of the Extensions. txt file in the Configuration folder. 2. Open Extensions. txt in Dreamweaver or in a text editor 3. Cut the line corresponding to the new default and paste it at the beginning of the file so that it becomes the first line of the file 4. Save the file 5. Restart dreamweav To see the new default, select File >Open, and look at the pop-up menu of file types To add new file types to the menu in the File >Open dialog box: 1. Make a backup copy of the Extensions. txt file in the Configuration folder 2. Open Extensions. txt in Dreamweaver or in a text editor. 3. Add a new line for each new file type ital letters. enter the filena that the new file type can h arated by commas. b. Add a colon and a brief description to show in the pop-up menu for file types that appear in the File>Open dialog box. For example, for JPEG files, enter the following: JPG, JPEG, JFIF: JPEG Image files 4. Save the file 5. Restart Dreamweaver To see the changes, select File>Open, and click the pop-up menu of file types 20 Customizing Dreamweaver
20 Customizing Dreamweaver Changing the default file type By default, Dreamweaver shows all the file types it recognizes in the File > Open dialog box. You can use a pop-up menu in that dialog box to limit the display to certain types of files. If most of your work involves a specific file type (such as ASP files), you can change the default display. Whatever file type is listed on the first line of the Dreamweaver Extensions.txt file becomes the default. To change the Dreamweaver default File > Open file type: 1. Make a backup copy of the Extensions.txt file in the Configuration folder. 2. Open Extensions.txt in Dreamweaver or in a text editor. 3. Cut the line corresponding to the new default and paste it at the beginning of the file so that it becomes the first line of the file. 4. Save the file. 5. Restart Dreamweaver. To see the new default, select File > Open, and look at the pop-up menu of file types. To add new file types to the menu in the File > Open dialog box: 1. Make a backup copy of the Extensions.txt file in the Configuration folder. 2. Open Extensions.txt in Dreamweaver or in a text editor. 3. Add a new line for each new file type. a. In capital letters, enter the filename extensions that the new file type can have, separated by commas. b. Add a colon and a brief description to show in the pop-up menu for file types that appear in the File > Open dialog box. For example, for JPEG files, enter the following: JPG,JPEG,JFIF:JPEG Image Files 4. Save the file. 5. Restart Dreamweaver. To see the changes, select File > Open, and click the pop-up menu of file types. NOTE If you want to see all file types in the File > Open dialog box (even the files Dreamweaver can’t open), you must select All Files (*.*). This is different from All Documents, which shows only the files Dreamweaver can open
Customizing the interpretation of third-party tags Server-side technologies such as ASP, Macromedia Cold Fusion, JSP, and PHP use special non- HTML code in hTml files: servers create and serve html content based on that code When Dreamweaver encounters non-HTML tags, it compares them with information in its third-party tag files, which define how Dreamweaver reads and displays non-HTML tags For example, in addition to regular HTML, ASP files contain ASP code for the server to interpret. ASP code looks almost like an HTML tag, but is marked by a pair of delimiters: i begins with < and ends with x>. The Dreamweaver Configuration/Third Party Tags folder contains a file named Tags. xml, which describes the format of various third-party tags, including ASP code, and defines how Dreamweaver displays that code. Because of the way ASP code is specified in Tags. xml, Dreamweaver does not try to interpret anything between the delimiters; instead, in Design view, it displays an icon that indicates ASP code. Your own tag database files can define how Dreamweaver reads and displays your tags. Create a new tag database file for each set of tags, to tell Dreamweaver how to display the tags z This section explains how to define the way Dreamweaver displays a custom tag, but m ldoesn't describe how to provide a way to edit the content or properties of a custom tag For information on how to create a Property inspector to inspect and change the properties of a custom tag, see Chapter 12, "Property Inspectors, "on page 279. Each tag database file defines the name, type, content model, rendering scheme, and icon for one or more custom tags. You can create any number of tag database files, but all of them must reside in the Configuration/ThirdParty Tags folder to be read and processed by Dreamweaver. Tag database files have the xml file extension. I f you are working on several unrelated sites at once (for example as a freelance eveloper), you can put all the tag specifications for a particular site in one file. Then simply include that tag database file with the custom icons and Property inspectors that you hand over to the people who will maintain the site You define a tag specification with an XMl tag called tagspec. For example, the following code describes the specification for a tag named happy <tagspec tag_name="happy "tag_type="nonempty"render_contents=false content_model="marker_model"icon="happy. gif"icon_width= icon_height= 18"></tagspec> You can define two kinds of tags using tagspec a Normal HTML-style tags The happy tag example is a normal HTML-style tag It starts with an opening<happy> tag, contains data between opening and closing tags, and ends with a closing</happy> g lays to customize Dreamweaver 21
Ways to customize Dreamweaver 21 Customizing the interpretation of third-party tags Server-side technologies such as ASP, Macromedia ColdFusion, JSP, and PHP use special nonHTML code in HTML files; servers create and serve HTML content based on that code. When Dreamweaver encounters non-HTML tags, it compares them with information in its third-party tag files, which define how Dreamweaver reads and displays non-HTML tags. For example, in addition to regular HTML, ASP files contain ASP code for the server to interpret. ASP code looks almost like an HTML tag, but is marked by a pair of delimiters: it begins with <% and ends with %>. The Dreamweaver Configuration/ThirdPartyTags folder contains a file named Tags.xml, which describes the format of various third-party tags, including ASP code, and defines how Dreamweaver displays that code. Because of the way ASP code is specified in Tags.xml, Dreamweaver does not try to interpret anything between the delimiters; instead, in Design view, it displays an icon that indicates ASP code. Your own tag database files can define how Dreamweaver reads and displays your tags. Create a new tag database file for each set of tags, to tell Dreamweaver how to display the tags. Each tag database file defines the name, type, content model, rendering scheme, and icon for one or more custom tags. You can create any number of tag database files, but all of them must reside in the Configuration/ThirdPartyTags folder to be read and processed by Dreamweaver. Tag database files have the .xml file extension. You define a tag specification with an XML tag called tagspec. For example, the following code describes the specification for a tag named happy: <tagspec tag_name="happy" tag_type="nonempty" render_contents="false" content_model="marker_model" icon="happy.gif" icon_width="18" icon_height="18"></tagspec> You can define two kinds of tags using tagspec: ■ Normal HTML-style tags The happy tag example is a normal HTML-style tag. It starts with an opening <happy> tag, contains data between opening and closing tags, and ends with a closing </happy> tag. NOTE This section explains how to define the way Dreamweaver displays a custom tag, but doesn’t describe how to provide a way to edit the content or properties of a custom tag. For information on how to create a Property inspector to inspect and change the properties of a custom tag, see Chapter 12, “Property Inspectors,” on page 279. TIP If you are working on several unrelated sites at once (for example, as a freelance developer), you can put all the tag specifications for a particular site in one file. Then simply include that tag database file with the custom icons and Property inspectors that you hand over to the people who will maintain the site
String-delimited tags start with one string and end with another string. They are like empty HTML tags(such as img)in that they dont surround content and don't have closing tags. If the happy tag were a string-delimited tag, the tag specification would include the start_ string and end_string attributes. An asp tag is a string-delimited cag: it starts with the string<% and ends with the string %> and it has no closing tag The following information describes the attributes and valid values for the tagspec tag Attributes marked with an asterisk ()are ignored for string-delimited tags. Optional attributes are marked in the attribute lists with curly braces((D); all attributes not marked with curly braces are required. iaspec> Description Provides information about a third-party tag Attributes lend_stringl, Detect_in_attribute, Parse_attributes/ (start_stringl stents, icontent model l icon_width, icon_height, equivalent_tagl, Iis_visuall, lserver_model l m tag_name is the name of the custom tag. For string-delimited tags, tag_name is used only to determine whether a given Property inspector can be used for the tag. If the first line of the Property inspector contains this tag name with an asterisk on each side, the inspector can be used for tags of this type. For example, the tag name for ASP code is ASP Property inspectors that can examine ASP code should have *ASP* on the first line. For formation on the Property inspector APl, see Chapter 12, "Property Inspectors, "on a tag_type determines whether the tag is empty (as the img tag is), or whether it contains anything between its opening and closing tags(as the code tag does). This attribute required for normal (nonstring-delimited)tags. It's ignored for string-delimited tags because they re always empty. Valid values are"empty"and"nonempty". render_contents determines whether the contents of the tag should appear in the Design view or whether the specified icon should appear instead. This attribute is required for nonempty tags and is ignored for empty tags. (Empty tags have no content. )This attribute applies only to tags that appear outside attributes. The contents of tags that appear inside the values of attributes of other tags are not rendered. Valid values are true"and"fal 22 Customizing Dreamweaver
22 Customizing Dreamweaver ■ String-delimited tags String-delimited tags start with one string and end with another string. They are like empty HTML tags (such as img) in that they don’t surround content and don’t have closing tags. If the happy tag were a string-delimited tag, the tag specification would include the start_string and end_string attributes. An ASP tag is a string-delimited tag; it starts with the string <% and ends with the string %>, and it has no closing tag. The following information describes the attributes and valid values for the tagspec tag. Attributes marked with an asterisk (*) are ignored for string-delimited tags. Optional attributes are marked in the attribute lists with curly braces ({}); all attributes not marked with curly braces are required. <tagspec> Description Provides information about a third-party tag. Attributes tag_name, {tag_type}, {render_contents}, {content_model}, {start_string}, {end_string}, {detect_in_attribute}, {parse_attributes}, icon, icon_width, icon_height, {equivalent_tag}, {is_visual}, {server_model} ■ tag_name is the name of the custom tag. For string-delimited tags, tag_name is used only to determine whether a given Property inspector can be used for the tag. If the first line of the Property inspector contains this tag name with an asterisk on each side, the inspector can be used for tags of this type. For example, the tag name for ASP code is ASP. Property inspectors that can examine ASP code should have *ASP* on the first line. For information on the Property inspector API, see Chapter 12, “Property Inspectors,” on page 279. ■ tag_type determines whether the tag is empty (as the img tag is), or whether it contains anything between its opening and closing tags (as the code tag does). This attribute is required for normal (nonstring-delimited) tags. It’s ignored for string-delimited tags because they’re always empty. Valid values are "empty" and "nonempty". ■ render_contents determines whether the contents of the tag should appear in the Design view or whether the specified icon should appear instead. This attribute is required for nonempty tags and is ignored for empty tags. (Empty tags have no content.) This attribute applies only to tags that appear outside attributes. The contents of tags that appear inside the values of attributes of other tags are not rendered. Valid values are "true" and "false