The following table describes the tags and attributes that you can use within a document type definition file Element Type Required Description Attribute Parent node Unique identifier across all document type definition files servermodel Specifies the associated server model case-sensitive); by default, the following values are valid ASP. NET CH SP NET VB ASP JavaScript Coldfusion get ServerModel DisplayName() functions returns these names the server model ted in the Configuration/ServerModels folder Extension developers can create new server models extending this list. 38 Customizing Dreamweaver
38 Customizing Dreamweaver The following table describes the tags and attributes that you can use within a document type definition file. Element Type Required Description Tag Attribute documenttype (root) Yes Parent node. id Yes Unique identifier across all document type definition files. servermodel No Specifies the associated server model (case-sensitive); by default, the following values are valid: ASP.NET C# ASP.NET VB ASP VBScript ASP JavaScript ColdFusion JSP PHP MySQL A call to the getServerModelDisplayName() functions returns these names. The server model implementation files are located in the Configuration/ServerModels folder. Extension developers can create new server models extending this list
Element Type Required Description Tag Attribute internaltype Dreamweaver treats a file. The nternaltype identifies whether the Design view is enabled for this document and handles special cases such as Dreamwea extensions The following values are valid DWTemplate(has special display HTML4 Text(Code view only) HTM C types should map to Dynamic HTML should map to HTML Script files(such as CSS, JS, VB, and CS)should map to If internaltype is DWTemplate, you should also specify c blank template that the New Document dialog box creates is not a recognized document type by the Server Behavior Bindings panel. Instances of this mplate are simply an HTML template A reference to the unique identifier of a meaningful only when internaltype is WTemplate. This attribute lets you Extensible document types in Dreamweaver 39
Extensible document types in Dreamweaver 39 internaltype Yes A broad classification of how Dreamweaver treats a file. The internaltype identifies whether the Design view is enabled for this document and handles special cases such as Dreamweaver templates or extensions. The following values are valid: Dynamic DWExtension (has special display regions) DWTemplate (has special display regions) HTML HTML4 Text (Code view only) XHTML1 XML (Code view only) All server model-related document types should map to Dynamic. HTML should map to HTML. Script files (such as CSS, JS, VB, and CS) should map to Text. If internaltype is DWTemplate, you should also specify dynamicid. If you omit dynamicid in this case, the new blank template that the New Document dialog box creates is not a recognized document type by the Server Behavior or Bindings panel. Instances of this template are simply an HTML template. dynamicid No A reference to the unique identifier of a dynamic document type. This attribute is meaningful only when internaltype is DWTemplate. This attribute lets you associate a dynamic template with a dynamic document type. Element Type Required Description Tag Attribute
Element Type Required Description Tac g Attrib winfileextension The file extension that is associated with the document type on windows. You specify multiple file extensions by using extension in the list is the extension that Dreamweaver uses when the user saves If two nonserver model-associated have the extension, Dreamweaver recognizes the first one as the document type for macfileextensi Ye The file extension that is associated with the document type on the Macintosh You specify multiple file ex ns by using a comma-separated list. The first extension in the list is the extension that weaver uses when the user sa two nonserver model-associated document types have the same file extension, Dreamweaver recognizes the first one as the document type for of the New document dialog box file Yes The file that is located in the DocumentTypes/New Documents folder that contains template content for priorversionservermodel No If this documents server model has a Dreamweaver UltraDev 4 equivalent. Ultra Dev 4 ColdFusion is a valid pric server model 40 Customizing Dreamweaver
40 Customizing Dreamweaver winfileextension Yes The file extension that is associated with the document type on Windows. You specify multiple file extensions by using a comma-separated list. The first extension in the list is the extension that Dreamweaver uses when the user saves a documenttype document. If two nonserver model-associated document types have the same file extension, Dreamweaver recognizes the first one as the document type for the extension. macfileextension Yes The file extension that is associated with the document type on the Macintosh. You specify multiple file extensions by using a comma-separated list. The first extension in the list is the extension that Dreamweaver uses when the user saves a documenttype document. If two nonserver model-associated document types have the same file extension, Dreamweaver recognizes the first one as the document type for the extension. previewfile No The file that is rendered in the Preview area of the New Document dialog box. file Yes The file that is located in the DocumentTypes/NewDocuments folder that contains template content for new documenttype documents. priorversionservermodel No If this document’s server model has a Dreamweaver UltraDev 4 equivalent, specify the name of the older version of the server model. UltraDev 4 ColdFusion is a valid prior server model. Element Type Required Description Tag Attribute
Element Type Required Description a Attribute The string that appears as a category (subtag) item under Blank Document in the New Document dialog box. You can place point to it indirectly for localization purposes. For more information on localizing this string see "Localized strings on page z Formatting is not allowed so HTML tags cannot be specified description The string that describes the document (subtag) type. You can place this string directly in he definition file or point to it indirectly information on localizing this string, see Localized strings"on page 44 Formatting is allowed so HTML tags can be specified z When the user saves a new document, Dreamweaver examines the list of extensions for althe current platform that are associated with the document type (winfileextension and macfileextension) Dreamweaver selects the first string in the list and uses it as the default file extension. To change this default file extension, you must reorder the extensions in the comma-separated list so the new default is listed first When Dreamweaver starts, it reads all document type definition files and builds a list of valid document types. Dreamweaver treats any entries within the definition files that hav nonexistent server models as nonserver model document types. Dreamweaver ignores entries that have bad contents or IDs that are not unique. If, while scanning the Configuration/Document Types folder, Dreamweaver finds no document type definition files or if any of the definition files appear to be corrupt, Dreamweaver closes with an error message Dynamic templates You can create templates that are based on dynamic document types. These templates are called dynamic templates. The following two elements are essential to defining a dynamic template Extensible document types in Dreamweaver 41
Extensible document types in Dreamweaver 41 When Dreamweaver starts, it reads all document type definition files and builds a list of valid document types. Dreamweaver treats any entries within the definition files that have nonexistent server models as nonserver model document types. Dreamweaver ignores entries that have bad contents or IDs that are not unique. If, while scanning the Configuration/DocumentTypes folder, Dreamweaver finds no document type definition files or if any of the definition files appear to be corrupt, Dreamweaver closes with an error message. Dynamic templates You can create templates that are based on dynamic document types. These templates are called dynamic templates. The following two elements are essential to defining a dynamic template: title (subtag) Yes The string that appears as a category item under Blank Document in the New Document dialog box. You can place this string directly in the definition file or point to it indirectly for localization purposes. For more information on localizing this string, see “Localized strings” on page 44. Formatting is not allowed, so HTML tags cannot be specified. description (subtag) No The string that describes the document type. You can place this string directly in the definition file or point to it indirectly for localization purposes. For more information on localizing this string, see “Localized strings” on page 44. Formatting is allowed, so HTML tags can be specified. NOTE When the user saves a new document, Dreamweaver examines the list of extensions for the current platform that are associated with the document type (winfileextension and macfileextension). Dreamweaver selects the first string in the list and uses it as the default file extension. To change this default file extension, you must reorder the extensions in the comma-separated list so the new default is listed first. Element Type Required Description Tag Attribute
m The value of the internal type attribute for the new document type must be DWTemplate The dynami cid attribute must be set, and the value must be a reference to the identifier of The following example defines a dynamic document type <documenttype id="PHP My SQL servermode1="PHP My SQL internaltype="Dynamic winfileextension="php. php3 macfileextension="php. php3 file="Default. php"> <title>PHP</title> description><! [CDATA[PHP document]]></description> </documenttype> Now, you can define the following dynamic template, which is based on this PHP_MySQl dynamic document type id="DWTemplate PHP internaltype="DWTemplate dynamicid="PHP My SQL macfileextension="php dwt file="Default. php. dwt"> <title>PHP Template</title> <description ><! [CDATA[Dreamweaver PHP Template document]]></ description> /documenttype When a Dreamweaver user creates a new blank template of type DWTemplate_PHP, Dreamweaver lets the user create php server behaviors in the file. Furthermore when the user creates instances of the new template, the user can create PHP server behaviors in the Instance In the previous example, when the user saves the template, Dreamweaver automatically adds a php dwt extension to the file. When the user saves an instance of the template, Dreamweaver adds the Php extension to the file. 42 Customizing Dreamweaver
42 Customizing Dreamweaver ■ The value of the internaltype attribute for the new document type must be DWTemplate. ■ The dynamicid attribute must be set, and the value must be a reference to the identifier of an existing dynamic document type. The following example defines a dynamic document type: <documenttype id="PHP_MySQL" servermodel="PHP MySQL" internaltype="Dynamic" winfileextension="php,php3" macfileextension="php,php3" file="Default.php"> <title>PHP</title> <description><![CDATA[PHP document]]></description> </documenttype> Now, you can define the following dynamic template, which is based on this PHP_MySQL dynamic document type: <documenttype id="DWTemplate_PHP" internaltype="DWTemplate" dynamicid="PHP_MySQL" winfileextension="php.dwt" macfileextension="php.dwt" file="Default.php.dwt"> <title>PHP Template</title> <description><![CDATA[Dreamweaver PHP Template document]]></ description> </documenttype> When a Dreamweaver user creates a new blank template of type DWTemplate_PHP, Dreamweaver lets the user create PHP server behaviors in the file. Furthermore, when the user creates instances of the new template, the user can create PHP server behaviors in the instance. In the previous example, when the user saves the template, Dreamweaver automatically adds a .php.dwt extension to the file. When the user saves an instance of the template, Dreamweaver adds the .php extension to the file