TINY-1195: add info on getMetadata for custom plugins

This commit is contained in:
Mattias Wikstrom
2017-08-23 14:51:38 +02:00
parent 1beb03e5fc
commit af428dfd78
2 changed files with 17 additions and 0 deletions
+13
View File
@@ -85,6 +85,15 @@ tinymce.PluginManager.add('example', function(editor, url) {
});
}
});
return {
getMetadata: function () {
return {
title: "Example plugin",
url: "http://exampleplugindocsurl.com"
};
}
};
});
```
@@ -100,6 +109,10 @@ tinymce.init({
});
```
## Exposing metadata
You can expose metadata from your plugin by returning an object with the property `getMetadata` with a function that returns an object with a `title` and `url` property. This metadata will then be used by the [Help Plugin]({{ site.baseurl }}/plugins/help/) to show the correct name and link for your plugin in the Plugins installed tab. See test plugin above for example.
## Language localization
If you want to have custom translations for your plugin you need to create a "langs" directory in your plugin directory. TinyMCE will then try to load language files based on the specified language core for example if the language is "sv_SE" it will try to load ```'<your plugin>/langs/sv_SE.js'```.
+4
View File
@@ -25,3 +25,7 @@ tinymce.init({
toolbar: "help"
});
```
## Exposing metadata for the help plugin
For information on how to expose metadata from you custom plugin to add it to the Installed plugins list in the Help plugin, see the [Creating a Plugin page]({{ site.baseurl }}/advanced/creating-a-plugin/#exposingmetadata).