TinyMCE plugin in umbraco

随声附和 提交于 2019-12-24 03:16:52

问题


I'm trying to add a custom button for umbraco richtext datatype, so i made a simple plugin for TinyMCE... But i cant seem to get it working, it shows up in the datatype, but not when i open the editor for some page...

//File: umbraco_client/tinymce3/plugins/addarrowheader/editor_plugin_src.js
//Same content in editor_plugin.js (just minified)

(function () {
tinymce.create('tinymce.plugins.mceAddArrowHeader', {
    init: function (ed, url) {
        ed.addCommand('addHeader', function () {
            alert('hello!');
        });

        ed.addButton('addArrow', { title: 'DoAdd', image: '/images/editor/umbracoTextGen.gif', cmd: 'addHeader' });
    },

    getInfo: function () {
        return {
            longname: 'mceAddArrowHeader',
            author: 'Bekker',
            authorurl: 'Eksponent.com',
            infourl: 'none',
            version: tinymce.majorVersion + "." + tinymce.minorVersion
        };
    }
});

// Register plugin
tinymce.PluginManager.add('mceAddArrowHeader', tinymce.plugins.mceAddArrowHeader);
})();

Added following to tinyMceConfig.config (/config/ folder)

//in <commands>
<command>
  <umbracoAlias>mceAddArrowHeader</umbracoAlias>
  <icon>images/editor/spellchecker.gif</icon>
  <tinyMceCommand value="" userInterface="true" frontendCommand="mceAddArrowHeader">addarrowheader</tinyMceCommand>
  <priority>76</priority>
</command>

//In <plugins>
//just using spellchecker.gif for test purpose, no custom icon yet...
<plugin loadOnFrontend="false">addarrowheader</plugin>

回答1:


It seemed to be a matter of wrong plugin folder naming... Didnt know that it had an impact, but renaming the folder to same name as the plugin (mceAddArrowHeader) solved the problem.



来源:https://stackoverflow.com/questions/16716284/tinymce-plugin-in-umbraco

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!