Read this article if you want to troubleshoot the following issues in Dreamweaver:
- When opening a file, you see this error message: "Can't find a valid editor for this file extension."
- The color-coding in Code view is not matching the color-coding for the file type you want.
- The server-model functionality is not available for your file type.
- You cannot open a page in Design view. The page only opens in Code view.
- When you click File > Save, or File > Open, you do not see the file type that you want.
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.
- The Extensions.txt file
The Extensions.txt file is a text file listing all file types recognized by Dreamweaver. This file can be edited in any external text editor like Notepad or Text Editor to add to the list of recognized file types. Do not modify the Dreamweaver configuration files in Dreamweaver itself. - The MMDocumentTypes.xml file
The MMDocumentTypes.xml file contains definitions of document types and a list of file extensions associated with each recognized document type. Adding file extensions to the Extensions.txt file allows Dreamweaver merely to recognize a file extension and allow files of this type to be opened in Dreamweaver. Adding file extensions to the MMDocumentTypes.xml file tells Dreamweaver how to treat this new file extension and to which document type this file extension belongs.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.
- Open in Code View
The Open in Code View preference identifies file extensions that do not allow Design view. To allow file editing in Design View, ensure that you remove the file extension (if it is listed) from the Open In Code View preference. To set this preference, click Edit > Preferences (Windows) or Dreamweaver > Preferences (macOS), and locate the File Types / Editors category.
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:
-
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:
- Dreamweaver CS3 on Windows Vista:
C:\Users\[username]\AppData\Roaming\Adobe\Dreamweaver 9\Configuration - Dreamweaver 8 on Windows Vista:
C:\Users\[username]\AppData\Roaming\Macromedia\Dreamweaver 8\Configuration - Dreamweaver CS3 on Windows XP:
C:\Documents and Settings\[username]\Application Data\Adobe\Dreamweaver 9\Configuration - Dreamweaver 8 on Windows XP & 2000:
C:\Documents and Settings\[username]\Application Data\Macromedia\Dreamweaver 8\Configuration - Dreamweaver CS3 on Mac OS X:
Mac HD:Users:[username]:Library:Application Support:Adobe:Dreamweaver 9:Configuration - Dreamweaver 8 on Mac OS X:
Mac HD:Users:[username]:Library:Application Support:Macromedia:Dreamweaver 8:Configuration
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.
- Dreamweaver CS3 on Windows Vista:
-
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.
Note:
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.
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:
-
Locate the MMDocumentTypes.xml file in the main Dreamweaver configuration folder (not the Dreamweaver user configuration folder). The location of this folder depends on the operating system and the version of Dreamweaver:
- Dreamweaver CS3 on Windows Vista & XP:
C:\Program Files\Adobe\Adobe Dreamweaver CS3\Configuration\DocumentTypes - Dreamweaver 8 on Windows Vista, XP & 2000:
C:\Program Files\Macromedia\Dreamweaver 8\Configuration\DocumentTypes - Dreamweaver CS3 on Mac OS X:
Mac HD:Applications:Adobe Dreamweaver CS3:Configuration:Document Types - Dreamweaver 8 on Mac OS X:
Mac HD:Applications:Macromedia Dreamweaver 8:Configuration:Document Types
- Dreamweaver CS3 on Windows Vista & XP:
-
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.
Note:
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.
-
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:
- bash
- c
- clojure
- coffeescript
- cpp
- csharp
- css
- dart
- diff
- ejs
- erb_html (Embedded Ruby)
- groovy
- handlebars
- haskell
- html
- hx (Haxe)
- java
- javascript
- json
- jsx
- less
- lua
- markdown
- perl
- php
- properties
- python
- ruby
- sass
- scala
- scss
- sql
- stylus
- svg
- turtle (RDF Turtle)
- vb
- vbscript
- xml
- yaml
For more information on modifying file types in Dreamweaver, see Extending Dreamweaver.