Tutorial: How To Add .chm Files To Dreamweaver’s Help

Objective

To add a .chm file to Dreamweaver‘s Help

Files Required

Any .chm file (I’ve used PHP’s documentation)

Tested With

Dreamweaver 8 on Windows (If anyone tested this on a Mac, please leave a comment!)

Little Bit Of Background

I recently began to learn PHP, and wasn’t very happy to find that Dreamweaver had no language support for PHP natively. Googled for methods to “add .chm files to the Dreamweaver Help” did not yield any useful results as well. Closest that I got was this article on Adobe livedocs, which I had tried to implement but failed :(. So here’s my own step by step tutorial to anyone who wants to add .chm files to Dreamweaver’s drop down Help. :)

Let’s Get Started!

Step 1
Navigate to the following folder:

C:/Program Files/Macromedia/Dreamweaver 8/Help

Step 2
Place a copy of your .chm file there. (For this example, I’ll be using php_manual_en.chm)

Step 3
Open help.xml

Step 4
Add the following:


to your code with reference to line 4 in the code snippet below.


    .
    .
    

Here are the explanations for book-id’s attributes

  • id: A unique identity. Just make sure that no other text in this xml file clashes with what you entered and you should be safe.
  • win-mapping: The name of the .chm help file in Windows
  • mac-mapping: The name of folder that contains the html files in Macintosh.

Step 5
Navigate to the following folder:

C:/Program Files/Macromedia/Dreamweaver 8/Configuration/Menus

Step 6
Open menus.xml

Step 7
Add the following:


to your code with reference to line 13 in the code snippet below. You can find it at the bottom of the whole xml file (add separators to beautify. 😀):


    .
    .
    
        .
        .
        
            
            
            
            
            
            
            
            .
            .
        
    

Here are the explanations for menuitem’s attributes:

  • name: The text that will be shown in the Dreamweaver’s Help.
  • enabled: Of course we want it enabled! 😀
  • arguments: This is important. Take note of what you entered here, for we’ll be needing it in a very short while.
  • file: This is the file with the JavaScript to launch our .chm file. We’ll take a look into it next.
  • id: A unique identity. Just make sure that no other text in this xml file clashes with what you entered and you should be safe.

Step 8
Navigate to the following folder:

C:/Program Files/Macromedia/Dreamweaver 8/Configuration/Menus/MM

Step 9
Open CSHelp.htm using Dreamweaver (Note: this is the file that we had specified in the above file attribute.)

Step 10
Add the following:

} else if ( arguments[0] == 'PHP' ) {
        helpDoc = "DW_PHP:index.html";

to your code with reference to line 22 in the code snippet below:

function receiveArguments() {
    if ( arguments[0] == 'DWUsing' ) {
        helpDoc = MM.HELP_mnuDWUsing;
    } else if ( arguments[0] == 'DWHelp' ) {
        helpDoc = MM.HELP_mnuDWHelp;
    } else if ( arguments[0] == 'CFUsing' ) {
        helpDoc = MM.HELP_mnuCFUsing;
    } else if ( arguments[0] == 'DWGuidedTour' ) {
        helpDoc = MM.HELP_mnuDWGuidedTour;
    } else if ( arguments[0] == 'DWTutorial' ) {
        helpDoc = MM.HELP_mnuDWGettingStarted;
    } else if ( arguments[0] == 'DWWhatsNew' ) {
        helpDoc = MM.HELP_mnuDWWhatsNew;
    } else if ( arguments[0] == 'UDGuidedTour' ) {
        helpDoc = MM.HELP_mnuUDGuidedTour;
    } else if ( arguments[0] == 'UDTutorial' ) {
        helpDoc = MM.HELP_mnuUDTutorial;
    } else if ( arguments[0] == 'Extending' ) {
        helpDoc = MM.HELP_mnuDWExtending;
    } else if ( arguments[0] == 'API' ) {
        helpDoc = MM.HELP_mnuDWAPI;
    } else if ( arguments[0] == 'PHP' ) {
        helpDoc = "DW_PHP:index.html";
    } else if ( arguments[0] == 'ConUsing' ) {
        helpDoc = "Con_Using:index.htm";
    } else {
        helpDoc = "DW_Using:index.htm";
    }
}

In the else if clause, the arguments[0] refers to the arguments attribute in the xml from Step 7. When assigning a value to helpDoc, the “DW_PHP” is referring to the id attribute in Step 4. And finally, we want the page to navigate to the index.html in the .chm file, so we have to add “:index.html” at the end. (Note: if you just assign “DW_PHP” to helpDoc, it will not work.)

Step 11
Save all files and restart Dreamweaver.

Step 12
When you launch the file from the Dreamweaver help menu, it might not show the intended index.html as we had expected. I can only assume that there’s some place that requires fixing, and frankly speaking, I have no idea where! 😛 As mentioned in Step 10, if you remove the “:index.html”, it will not even launch the appropriate .chm that you want as Dreamweaver has mapped the default to it’s own help.

Final Note

If anyone is able to fix the last issue, please drop a comment and let me know! Or if you have an easier method to make this work, I’ll be glad to hear from you. 😉

About Flashmech

I have too many things in plans for my own good. But well, that's me. :) I love God, praise Him, and trust that He has the best plans in life for me.
This entry was posted in Tutorials and tagged . Bookmark the permalink.

One Response to Tutorial: How To Add .chm Files To Dreamweaver’s Help

  1. harris says:

    Your post is knowledgeable for all web developers.
    Keep trying to post such good knocks in the field of IT.