Topic on Talk:VisualEditor/Gadgets/Add a tool

Problems when adding multiple Templates

3
Brue (talkcontribs)

Hi,

I adapted the example to add a template in a private wiki. The template accepts something like a reference and a text and generates an internal link to a local file ressource. It works very well generally, I do have only one problem in the VisualEditor "visual" mode.

When I add the template via the menue, I can then press the "edit" button of the template in the VisualEditor and edit the parameters of the template. I can also use the menue a second time to add the same template a second time. When I then edit the parameters of the second template, also the parameters of the first already inserted templates get modified which is not intended to happen.

I guess it is because the tool insers the same instance of the object again instead of creating a new object or something like that (?), but my JavaScript expertise is not good enough to know what I need to change here.

If someone has a hint I would be thankful. Thank you

Whatamidoing (WMF) (talkcontribs)

Not very many people watch this page, so you might have better luck if you ask at the Project:Support desk.

They'll probably need to see the code you're using.

Brue (talkcontribs)

Hi, I guess you were right. I'm going to post it there, Thanks!

Reply to "Problems when adding multiple Templates"