To add a .chm file to Dreamweaver’s Help
Any .chm file (I’ve used PHP’s documentation)
Dreamweaver 8 on Windows (If anyone tested this on a Mac, please leave a comment!)
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.
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:
<book-id id="DW_PHP" win-mapping="php_manual_en.chm" mac-mapping="PHP Manual (English)"/>
to your code with reference to line 4 in the code snippet below.
1
2
3
4
5
| <help-books>
.
.
<book-id id="DW_PHP" win-mapping="php_manual_en.chm" mac-mapping="PHP Manual (English)"/>
</help-books> |
Here’s the explainations 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:
<menuitem name="PHP Manual (English)" enabled="true" arguments="'PHP'" file="Menus/MM/CSHelp.htm" id="DWMenu_Help_PhpManual" />
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.
):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
| <menus xmlns:MMString="http://www.macromedia.com/schemes/data/string/">
.
.
<menubar name="Main Window" id="DWMainWindow">
.
.
<menu name="_Help" id="DWMenu_Help">
<menuitem name="_Dreamweaver Help" enabled="true" arguments="'DWHelp'" file="Menus/MM/CSHelp.htm" id="DWMenu_Help_DWHelp" />
<menuitem name="_Getting Started with Dreamweaver" enabled="true" arguments="'DWTutorial'" file="Menus/MM/CSHelp.htm" id="DWMenu_Help_GettingStarted" />
<menuitem name="Dreamweaver _LiveDocs" enabled="true" command="dw.browseDocument('http://livedocs.macromedia.com/go/livedocs_dreamweaver')" id="DWMenu_Help_LiveDocs" />
<menuitem name="What's _New in Dreamweaver 8" enabled="true" arguments="'DWWhatsNew'" file="Menus/MM/CSHelp.htm" id="DWMenu_Help_WhatsNew" />
<separator />
<menuitem name="PHP Manual (English)" enabled="true" arguments="'PHP'" file="Menus/MM/CSHelp.htm" id="DWMenu_Help_PhpManual" />
<separator />
.
.
</menu>
</menubar>
</menus> |
Here’s the explainations 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:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
| 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.
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 and add a link here.
Hope this helps!