Tips for Macromedia Approved Extensions writing
Here are some tips about building extensions compilant to Macromedia Approved standards.
- When writing the .mxi file description use no more than three </br> to separate one paragraph from another
- If the extension is an object and his destination is not the Common category in the Object panel. You have to make some changes in the <configuration-changes> tag of the .mxi file. So, if the extension - named in these examples "My Extension # 1" - is going to have its own category (e.g.: My Extensions), you will have to create not only the subfolder My Extensions inside the Objects folder, but also you have to modify these lines in the <configuration-changes> tag of the .mxi file:
<configuration-changes>
<menu-insert appendTo="DWMenu_Insert">
<menu name="My Extensions" id="Me_DWMenu_Insert_My_Extensions">
</menu>
</menu-insert>
<menu-insert appendTo="Me_DWMenu_Insert_My_Extensions">
<menuitem name="My_Extension_#_1" file="My Extension # 1.htm"
id="Me_DWMenu_Insert_My_Extension_#_1" />
</menu-insert>
</configuration-changes>
Instead, if you're going to insert this extension in an exsisting Macromedia Object category, such as Forms, the <configuration-changes> tag has to be written this way:
<configuration-changes>
<menu-insert insertAfter="DWMenu_Insert_FormObject_JumpMenu"
skipSeparator="true">
<menuitem name="My_Extension_#_1" file="My Extension # 1.htm"
id="Me_DWMenu_Insert_My_Extension_#_1" />
</menu-insert>
</configuration-changes>
As you can see, modifying the <configuration-changes> tag, you have to choose your own "id" that precedes DWMenu_Insert... In these examples the id choosen has been Me. Its' a good idea to choose as id name the same name of your subfolder - if you need to create one - in the Shared folder.
It's also a good idea making the same changes in <configuration-changes> tag, when writing other kind of extensions, such as Commands, that add submenu to other Dreamweaver or UltraDev menu.
Also adding a sub-sub menu for each extension will make easyer for users to find them (e.g.: "Commands > Me > My first Commmand" and "Commands > Me > My second Commmand"). So all yours Commands can be quickly found as a sub menu of Me, which is a sub menu of Commands - Use the shared attribute, in the <file source=.../> tag of .mxi file, set to true, only if more than one extension will be using that file. e.g.:
<file source=" my Logo.gif" destination="$dreamweaver/Configuration/Shared/Me/images/" shared="true" />
As you can see in the example, a folder named images had been created inside in Me sub folder of Shared folder.
It's a good system adding as much folders a you need in your personal shared sub folder. So you could have, inside "Me" sub folder, various folder e.g.: "images" for your logo or other shared images or "scripts" if more than an extension use the same js file. It will make simpler your further extensions development.
Comments
Be the first to write a comment
You must me logged in to write a comment.