In Windows Explorer, do one of the following:
- In Windows XP, choose Tools > Folder Options.
- In Windows Vista, choose Organize > Folder and Search Options.
Learn how to make Dreamweaver recognize new file types by editing the Extensions.txt and MMDocumentTypes.xml files.
Read this article if you want to troubleshoot the following issues in Dreamweaver:
Dreamweaver ships with the ability to edit and display many different file types. This article focuses on customizing Dreamweaver to recognize new file types by editing the Extensions.txt and MMDocumentTypes.xml files. As a user, you can also set the Open In Code View settings to see the new file types in Design view.
In this article, only basic aspects of editing the MMDocumentTypes.xml file are discussed. For a detailed overview of editing this file, see Extending Dreamweaver from within Dreamweaver. Click Help > Extending Dreamweaver, and search for MMDocumentTypes.xml.
When opening a file that Dreamweaver doesn't recognize, you see the "Can't find a valid editor for this file extension" error message. You can add new extensions to the list of extensions that Dreamweaver recognizes. To add new extensions, edit the Extensions.txt file. Entries in the Extensions.txt file also control the order in which files are listed in the File > Open and File > Save dialog boxes. As an example, add the .inc file type to Dreamweaver.
Note: This procedure requires you to locate hidden files, hidden folders, and extensions for known file types. By default, Windows Explorer does not show hidden files, hidden folders, and file name extensions that the system recognizes.
To show hidden files, hidden folders, and extensions for known file types:
In Windows Explorer, do one of the following:
Click the View tab in the Folder Options dialog box.
In Advanced Settings, select Show Hidden Files And Folders.
Deselect Hide Extensions For Known File Types.
Click OK.
To add file types to the Extensions.txt file:
Locate the Extensions.txt file within the Dreamweaver user configuration folder. The location of this folder depends on the operating system and the version of Dreamweaver:
Note: Edits to this file are only available to the current user. Changes made to files within the user profile is not available to other users. For more information about manually editing Dreamweaver configuration files in a multiuser environment, see Customizing Dreamweaver in a multiuser environment.
Open Extensions.txt in any external text editor like Notepad or Text Editor.
Do not modify the Dreamweaver configuration files in Dreamweaver itself.
Add the extension to the All Documents line. Extensions must be in uppercase letters and separated by commas. For example, HTML,HTM,SHTM,SHTML,INC.
To add extensions to an existing document group, add the extension to the extension list for the desired group. To add a new document group, add a new line that contains the new document type and a listing of associated extensions. For example: INC:Include Files
You can also add this line to the Server Side Include list already within the file.
To see the changes, open Dreamweaver and open a file with the newly added file extension. The file opens only in Code view in Dreamweaver.
Select File > Save As, and click the Save As Type pop-up menu. You see the *.inc option as the recognized file extension in the Include Files option. You see the same option in the Files Of Type pop-up menu in File > Open.
The order in which the extensions are listed is the order in which they will appear in the File > Open and File > Save dialog boxes.
To get Design view, color coding, and server behavior functionality working, you must edit the MMDocumentTypes.xml file, as described in the following sections.
The MMDocumentTypes.xml file contains information about the server model, color coding style, descriptions, and so on for each known document type.
In addition to adding extensions to the Extension.txt file, new extensions must also be added to the file extension lists for the associated document type. If not, Dreamweaver does not know how to display this file type. Dreamweaver then opens the file in Code view by default.
If this extension is not associated with any defined document type, a new document type is created. To create a new document type, see Extending Dreamweaver from within Dreamweaver, click Help > Extending Dreamweaver, and search on MMDocumentTypes.xml.
Note: In this article, 'document type definition' refers to files that contain information about documents recognized by Dreamweaver. Document type definition is not to be confused by 'DTDs' mentioned in XML documentation.
Perform the following steps to add extensions to a document type definition in the MMDocumentTypes.xml file:
Open MMDocumentTypes.xml in any external text editor like Notepad or Text Editor.
Do not modify the Dreamweaver configuration files using Dreamweaver.
Find the tag set for the desired document type.
The following is the default document type definition for HTML documents from the MMDocumentTypes.xml file:
<documenttype id="HTML" internaltype="HTML" winfileextension="html,htm,shtml,shtm,stm,tpl,lasso,xhtml" macfileextension="html,htm,shtml,shtm,tpl,lasso,xhtml,ssi" writebyteordermark="false">
Add the desired extension to the winfileextension and macfileextension attributes of the documenttype tag. For example, winfileextension="html,htm,shtml,shtm,stm,tpl,lasso,xhtml,inc"
The code above adds the INC file extension to the list of files that Dreamweaver treats as HTML files. When you add extensions to lists for macOS and Windows for this file type, Dreamweaver opens this file type in Design view.
To see the changes, open Dreamweaver and open a file that has the newly added file extension.
The Design view, code coloring, and server behavior functionality (if applicable) work now.
The order in which extensions are listed is important. The first extension in the extensions list is the default extension that is used for this file type.
If you made a backup of the MMDocumentTypes.xml and left it in the Configuration/DocumentTypes folder, you see multiple warning messages pop up when you launch Dreamweaver.
You see error messages like: "The Document Type "HTML" will not be added because it uses a file extension that is already associated with a prior Document Type."
You also see this error message if you have the same file type listed more than once in the MMDocumentTypes.xml.
To stop these warning messages, move your backup copy of the MMDocumentTypes.xml file outside the Configuration/DocumentTypes folder.
The final step is to check the File Types / Editors preference settings (Edit > Preferences) and ensure that this file extension is not listed in the Open In Code View field. By default, the INC file extension appears on this list. If you remove ".inc" from the Open in Code View list, you can view files with this extension in Design view.
After you perform the steps to add a MMDocumentTypes.xml file, proceed with the following procedure to enable code coloring in custom file types.
Exit the Dreamweaver application.
Open the brackets.json file from the following location, using a text editor:
Win: %appdata%\Adobe\Dreamweaver CC xxxx\en_US\Configuration\Brackets\brackets.json
macOS: ~/Library/Application Support/Adobe/Dreamweaver CC XXXX/en_US/Configuration/Brackets/brackets.json
Here, xxxx refers to the Dreamweaver version. For example, 2017.
In the .json file, after last Key/Value Pair, enter the following delimiter ,(comma) and type this text:
"language.fileExtensions": { ".ext": "php" }
Replace .ext with the list of comma separated file extensions for which code coloring has to be added.
Replace php with the desired document type. Document types that are supported are:
Save the file, and launch Dreamweaver.
For more information on modifying file types in Dreamweaver, see Extending Dreamweaver.