Macromedia dreamweaver 8-extending dreamweaver Manuel D’Utilisation
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>
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]]></
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.
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.
.php.dwt extension to the file. When the user saves an instance of the template, Dreamweaver
adds the .php extension to the file.