Home Conticreative Blogs The Joomla Blog Making Dreamweaver recognize .INI and other non-native files

Blogs - The Conticreative Joomla Blog

Making Dreamweaver recognize .INI and other non-native files

Attention: open in a new window. PDFPrintE-mail

Written by Marco Conti Monday, 28 September 2009 16:14

User Rating: / 3
PoorBest 

As most of my readers already know, I use Adobe Dreamweaver as my main IDE (Integrated Development Enviroment). While I also use a number of other powerful code editors, like Coda, BBedit, TextMate (on the Mac) and Notepad++, PHP Eclipse and others for PC, Dreamweaver has been my choice for many years, regardless of the low opinion some developers have for this program.

In fact, I found that not only Dreamweaver is a powerful HTML, CSS and PHP editor, but when working with Joomla, Wordpress, Drupal, Magento and pretty much90% of Open Source web scripts out there, Dreamweaver has many advantages , not least the infamous "Design" view, which in split mode can reduce the time it takes to edit dynamically driven templates by a factor of 5. (And incidentally, I am in the process of writing a book on how to apply these techniques to Joomla!).

However, Dreamweaver has a maddening shortcoming, especially for those of us working with file types Dreamweaver does not recognize. If my memory serves (I have set up my own Dreamweaver so long ago that I may be wrong here), Dreamweaver does not recognize .sql, .ini, .htaccess, .config, .info and many more.

In fact, in some cases it won't even open them. However, to have Dreamweaver open these files is fairly easy. Just go to the Preferences > File Types/Editors and insert the missing extensions in the "Open in Code View" field. Save and from that point on Dreamweaver will happily open any of those files.

In fact, just recently I added .csv to the list so I could work on a Virtuemart product import that was driving me nuts.

But even if Dreamweaver can now open those files, it still cannot search them if they are inside a folder and you want to perform a site search (or folder search) to find a string inside one of those files.

Since Joomla 1.5 that's become quite a chore. Joomla 1.0 used to keep all language files in "english.hp" files in the language folder, but since Joomla 1.5 these language files have been moved to .ini files in the same location.

While it was possible once to just perform a folder wide search for any Joomla alert or any text generated by the system, with Joomla 1.5 that's become impossible. Dreamweaver will not search for a string inside multiple .ini files.

We can fix that quite easily though. Dreamweaver keeps these extensions in a file called, quite appropriately, extensions.txt inside the user folder (precise location varies depending on the Operating System and the version). It's a simple matter of finding the extension.txt file and adding any additional extension you may need.

Code coloring is another matter though. I built a few Magento based shopping carts and the first hurdle I had to overcome (among many - Magento is a headache to work with) was that most of the Magento files use an oddball extension for what otherwise are simple .php files: .phtml. Why? Your guess is as good as mine.

The result was that while I could open the .phtml files quite easily, I could not search whithin nor I could use the code coloring. PHP in Black and White is not nearly as fancy as the regular PHP. I could not find diddly!

In any event, let's first tackle how to make Dreamweaver recognize .ini files.

Let's first find this "extensions.txt" file. Below is an excerpt from the Adobe technote located at: http://kb2.adobe.com/cps/164/tn_16410.html (Note: Dreamweaver CS4, in my experience is identical to CS3), depending on your OS, navigate t one of the folders below:

  • 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

Once you get to the extension.txt file on your system proceed as follows (this is again taken from the Adobe technote mentioned above):

 


  1. Open Extensions.txt in any external text editor like Notepad or Text Editor.
    Do not modify the Dreamweaver configuration files in Dreamweaver itself.
  2. Add the extension to the All Documents line. Extensions must be in uppercase letters and separated by commas. (INC should already be listed by default. If not, add it.)
    Example: HTML,HTM,SHTM,SHTML,INC
  3. 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 as well as a listing of associated extensions.
    Example: INC:Include Files
    (This can also be added to the Server Side Include list already within the file.)
  4. Save the file and restart Dreamweaver.
  5. To see the changes, open Dreamweaver and open a file with the newly added file extension. It should now open in Code view only in Dreamweaver. Select File > Save As, and click the Save As Type pop-up menu. You should now see an option for Include Files with *.inc as the recognized file extension. It's the same for the Files Of Type pop-up menu in File > Open.

To get Design view, color coding, and server behavior functionality (if applicable) working, you need to edit the MMDocumentTypes.xml file, as described below.

The MMDocumentTypes.xml file

Where the Extensions.txt file contains the list of extensions recognized by Dreamweaver, the MMDocumentTypes.xml file contains information about the server model, color coding style, descriptions, and so forth 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 will not know how to display this file type and will open it in Code view by default. If this extension is not associated with any defined document type, a new document type should be created. To create a new document type, see Extending Dreamweaver (from within Dreamweaver, choose Help > Extending Dreamweaver, and search on MMDocumentTypes.xml).

Steps to add extensions to a document type definition in the MMDocumentTypes.xml file:

  1. 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
  2. Open MMDocumentTypes.xml in any external text editor like Notepad or Text Editor. Do not modify the Dreamweaver configuration files in Dreamweaver itself.
  3. Find the tag set for the desired document type. Below 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">
  4. 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. Adding extensions to the Mac OS and Windows lists for this file types allows Dreamweaver to open this file type in Design view as other files with defined HTML file extensions.

  5. Save MMDocumentTypes.xml and restart Dreamweaver.
  6. To see the changes, open Dreamweaver and open a file that has the newly added file extension. You should see that Design view, code coloring and server behavior functionality (if applicable) are working now.

Note: The order in which extensions are listed is important. The first extension in the extensions lists will be the default extension used for this file type.

 


That's it, after you have made these changes your Dreamweaver will be able to read, search and interact with many file types it previously ignored.

This information is available elsewhere, the Adobe Technote is the major source, but I decided to include it in my blog so that I can refer to it more easily and because I believe that the more it is diffused the easier it is for Dreamweaver users to find it.

Enjoy

Trackback(0)

TrackBack URI for this entry

Comments (1)

Subscribe to this comment's feed

Show/hide comments
Thanks
Cheers! I'm developing Magento sites now so this has really helped searching and editing those .phtml files
Barny Shergold , November 24, 2009

Write comment

smaller | bigger

busy

10 Minute Joomla! Tips Blog

Conticreative joomla book reviews

Podcast Feed

Independent joomla hosting reviews

Books

Books we suggest...

 

Spreadfirefox Affiliate Button
switch the positions on