Tutorial: How to create new toolbar

In the new tutorial article for OnlyOffice 8.1 (Not Found), it mentions that you can create a new tab for a customized plugin. However, I can’t find any examples on how to do this properly. Could you provide an example?

Hello @man200thcs

The link in your post in invalid. I believe you are referencing this one:

There is section API enhancements for plugins that explains how to create plugin with custom toolbar and also a link to API that is used to add custom items and tab for your plugin.

That’s the one, but based on the information I have, I have no clue how to implement it. Should I include it inside the JS file of the plugin, like in the “window.Asc.plugin.init” block?

At this moment we are in process of writing respective documentation about new functionality. More detailed info will be available later.

Yes, these methods are used in a main JS file with plugin code.

Hello again @man200thcs

Please check out this blog post about developing plugin as a tab:

Thank you, the tutorial did work. Now from the item in the toolbar, I try to open a Plugin, still the method that I found like ActivateWindow doesnt work.
Here the sample:

this.attachToolbarMenuClickEvent(“openTestPlugin”, function (data) {
this.executeMethod(“ActivateWindow”, [
“asc.{C36DDFB5-08F0-4A68-B829-5FB1F7D49331}”,
]);
});

Do you have any suggestion?

Can you please share your goal with the plugin? I’m not sure what you’d like to achieve.

From a item in the toolbar, i want to activate a plugin like tag control example. It means that when I click the button in the toolbar, I expect the panel from the second plugin to be opened.

I’m not quite following this description. Are you developing your own plugin and you want to invoke items from another plugin?

I expect the item from the tooltab plugin to open another plugin. For example, when I click the translation item in the tooltab, it should open the transtate plugin.

Hello @man200thcs
If you don’t mind, I will join this thread too.
Do I understand it right that you have a plugin in the toolbar and you want to open the Translator plugin similar to how you open it when clicking on the relative icon in the toolbar?

Yes, I want to achieve the same behavior: When I click on the custom toolbar item, it should behave like opening the plugin in the plugins tab. So that I can re-use the plugin that I have done before.

There’s no way to call a plugin from another one. However, let’s take a closer look at the desired scenario. Could you please provide us with detailed usage scenario (step-by-step)? You can make screenshots or draw a scheme. We will check if something can be done.