Reply to thread

The code to insert custom bbcode buttons in "js/tinymce/themes/xenforo/editor_template.js" is not quite correct. It now reads

[code]

tinymce.each(tags, function(tag, tagName) {

  tb.add(controlManager.createButton('xenforo_custom_bbcode_' + tag,

      {title : tag[0], image : tag[1], cmd : 'xenForoWrapBbCode', ui : false, value : tagName}

  ));

});

[/code]

however "tag" is an array so it cannot be used as part of button's name in "'xenforo_custom_bbcode_' + tag". This code fragment should look like

[code]

tinymce.each(tags, function(tag, tagName) {

  tb.add(controlManager.createButton('xenforo_custom_bbcode_' + tagName,

      {title : tag[0], image : tag[1], cmd : 'xenForoWrapBbCode', ui : false, value : tagName}

  ));

});

[/code]

 

 

This way developers will be able to add custom bbcode buttons something array similar to

[code]

, xenforo_custom_bbcode_tags:  { "bbcode": ["Button title", "url/to/image"] }

[/code]

in "editor_tinymce_init" template hook.


Back
Top Bottom