I active wysiwyg module and then i install the ckeditor as well.

I try to put the ckeditor mathjax plugin, but it doesn't work by a module. My module is this

<?php
/**
 * Implements hook_wysiwyg_plugin().
 */
function ckeditor_mathjax_wysiwyg_plugin($editor, $version) {
  switch ($editor) {
    case 'ckeditor':
      return array(
        'mathjax' => array( // Internal plugin name
          'extensions' => array(
            'mathjax' => t('mathjax'), // Internal plugin name as key, name visible in editor profile config UI as value.
          ),
          'load' => TRUE,
          'internal' => FALSE,
          'path' => wysiwyg_get_path('ckeditor_plugins') . '/mathjax',
        ),
      );
     break;
  }
}
?>

In the html source it appears that the mathjax library is inserted in html code, but it don't load any button.

Thanks in advanced

Comments

xarbot’s picture

Issue summary: View changes
TwoD’s picture

The plugin definition you've made says 'mathjax' is an extension, and by definition has no buttons.

Change it into this:

/**
 * Implements hook_wysiwyg_plugin().
 */
function ckeditor_mathjax_wysiwyg_plugin($editor, $version) {
  switch ($editor) {
    case 'ckeditor':
      return array(
        'mathjax' => array( // Internal plugin name
          'buttons' => array(
            'Mathjax' => t('mathjax'), // Internal plugin name as key, name visible in editor profile config UI as value.
          ),
          'load' => TRUE,
          'internal' => FALSE,
          'path' => wysiwyg_get_path('ckeditor_plugins') . '/mathjax',
        ),
      );
     break;
  }
}

and try again. For widget plugins, CKEditor capitalizes the widget name and uses it for the internal button name, which is why I changed 'mathjax' to 'Mathjax' there.

Also make sure the plugins required by this widget are available as well.

xarbot’s picture

It works as well, thanks

Xarbot

TwoD’s picture

Status: Active » Fixed

Glad I could help!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.