Skip to main content
New Participant
August 26, 2009
Question

Unable to get extension to insert code - any tips?

  • August 26, 2009
  • 1 reply
  • 2607 views

I'm building an extension - for the first time - to just insert some of my own Template Language API code into an HTML document. The idea being that the user selects "Insert > Template Language > Template Language Item" to pop in the piece of code they need.

Everything looks right to me, the mxi packages in to an mxp just fine, and I'm able to place my "Template Language" menu correctly under the "Insert" item in the toolbar. The issue I'm running into is this: You select the code snippet to insert and nothing happens. No error, no output, nothing.

I've set up the mxi file according to Adobe's provided documentation and examples, and I've set up the core html files according to what comes included with Dreamweaver (I used hr.htm as the example). I've been working on this for over a week and whittling down mistakes, but now I'm at a loss.

I'd really appreciate some help - I'll attach the mxi file, and I can attach the code files if anyone cares to give me a hand.

Thanks in advance.

This topic has been closed for replies.

1 reply

pziecina
Brainiac
August 26, 2009

Hi

Unfortunately due to my current workload I am not able to offer any personal help with the extension.

It is unlikely that the problem is with your mxi/mxp files but more probable with your html or js files.

The first thing to check is that they have the correct doctype for the extension and that your js is working correctly, and that any links are referring to the correct js or  html files, as these are often the cause of problems.

(This documentation is for cs4, and you probably already have your own copy - http://help.adobe.com/en_US/Dreamweaver/10.0_Extending/WS5b3ccc516d4fbf351e63e3d117f53d5f9f-7ffe.html ).

PZ

New Participant
August 27, 2009

While I do initially agree that the issue may be in the html files used to insert content, I have found that they do work if I manually place them into the configuration/Objects folder then manually edit the insertbar.xml file, the commands appear in the insert bar and the code is inserted into the document when I click each button.

Unfortunately, a manual installation of this code is out of the question, as this extension will serve several users.

When I built the HTML files, I used Adobe's HR.htm as a template. Is there a certain way I should build the HTML that differs from that file? I'm completely stumped on this. I've tried to follow the examples Adobe has set to the letter.

New Participant
August 28, 2009

Hi

Try changing- $Dreamweaver/configuration/TemplateLanguage

to - $Dreamweaver/configuration/Objects/TemplateLanguage

in your mxi file then repackage.

PZ


Thanks, PZ, that put me on the right track. It turns out I had to do some more wrangling in the Javascript to get it to run correctly. One last thing: as it stands, all of my code snippet commands are in the "commands" menu, when they should be in the "insert" menu. If I set my mxi file up as I have in the one attached to my first post, the code will not insert. It looks to me like it's set up correctly, but obviously something is off.

Attached is my current mxi file, which treats all of the code snippets as commands instead of inserts. Is there a different way to go about setting up the mxi file? Setting the "type" as "insertbar" up at the top doesn't seem to change anything.