×

Discover

WIRIS plugin for Joomla

DOWNLOAD

1 Requirements

  • Joomla 1.5 or higher installed.
  • For Joomla versions previous to 3.2.x: JCE module with TinyMCE
  • A valid license to install the plugin in a production environment; otherwise, you can use the downloaded file just for demo purposes.

2 Copy files

Unzip the TinyMCE WIRIS Plugin and copy the tiny_mce_wiris directory into your Joomla TinyMCE plugins directory. These would be the final paths depending on your Joomla version:

3.2.x or higher: JoomlaRoot/media/editors/tinymce/plugins/tiny_mce_wiris

1.5.14 to 3.1.6JoomlaRoot/media/editors/tinymce/jscripts/tiny_mce/plugins/tiny_mce_wiris

Older than 1.5.14JoomlaRoot/plugins/editors/tinymce/jscripts/tiny_mce/plugins/tiny_mce_wiris

Now, give write permissions to <tiny-mce-plugins-directory>/tiny_mce_wiris/cache and <tiny-mce-plugins-directory>/tiny_mce_wiris/formulas directories to the web server user (it will be used to store formula MathML codes and temporal images).

3 Activate WIRIS plugin for TinyMCE

3.1 Joomla 3.7.x or higher

The available WIRIS buttons are formulaEditor and formulaEditorChemistry.

  1. Open the file JoomlaRoot/media/editors/tinymce/skins/lightgray/skin.min.css

  2. Put at the final ".mce-i-tiny_mce_wiris_<formulaEditor or formulaEditorChemistry>:before {content:url('/JoomlaRoot/media/editors/tinymce/plugins/tiny_mce_wiris/icons/formula.png');}" (or chem.png instead formula.png if you want to add formulaEditorChemistry button)

  3. Open the file JoomlaRoot/plugins/editors/tinymce/tinymce.php

  4. Replace the line with "$custom_plugin = trim($levelParams->get('custom_plugin', ''));" to "$custom_plugin = trim($levelParams->get('custom_plugin', 'tiny_mce_wiris'));" or if there are other plugins, add a SPACE and 'tiny_mce_wiris'

  5. Add to $buttons array into getKnownButtons function the element " 'tiny_mce_wiris_<formulaEditor or formulaEditorChemistry>' => array('label' => 'WIRIS Editor', 'plugin' => 'tiny_mce_wiris')"

  6. Go to the browser and access to the control panel (JoomlaRoot/administrator/index.php)

  7. Go to Extensions>Plugins, search by TinyMCE and click it in order to change TinyMCE configuration

  8. Into the toolbar that shows the available buttons, you will see WIRIS buttons. Drag and drop to the toolbar set that you want to add it

3.2 Joomla 3.2.x to 3.6.x

Edit /plugins/editors/tinymce/tinymce.php and include the plugin and buttons in the mode you are using (Advanced, Extended, etc.). Joomla uses the Advanced mode by default. The name of the plugin is tiny_mce_wiris and the button names are tiny_mce_wiris_formulaEditor (WIRIS editor) and tiny_mce_wiris_CAS (WIRIS cas).

Note: In your tinymce.php look for /* Advanced mode*/ or /* Extended mode*/ to find the appropiate block of code.

Example:

$toolbar2 = "outdent indent | undo redo | link unlink anchor image code | hr table | subscript superscript | charmap | tiny_mce_wiris_formulaEditor tiny_mce_wiris_CAS";

···
plugins : \"table link image code charmap autolink lists importcss tiny_mce_wiris\",

3.3 Joomla versions from 1.5.14 to 3.1.6

Open plugins/editors/tinymce.php (in Joomla 2.5.x or above this file is inside plugins/editors/tinymce/) and search the line with this text:

$buttons1_add_before = implode(',', $buttons1_add_before);

Now add this code before the line:

$plugins[] = 'tiny_mce_wiris';
$buttons2_add[] = 'tiny_mce_wiris_formulaEditor';  // For WIRIS Formula Editor
$buttons2_add[] = 'tiny_mce_wiris_CAS';            // For WIRIS CAS

The final code should look like:

…
$plugins[] = 'tiny_mce_wiris';
$buttons2_add[] = 'tiny_mce_wiris_formulaEditor';  // For WIRIS Formula Editor
$buttons2_add[] = 'tiny_mce_wiris_CAS';            // For WIRIS CAS

$buttons1_add_before = implode(',', $buttons1_add_before);
…

The final step is the activation of the extended tinyMCE editor. In Joomla administrator panel, go to Extensions > Plugin Manager and click on Editor – TinyMCE. Now, on Functionality field (on right panel), choose Extended and then save changes.

3.4 Joomla older than 1.5.14

Open plugins/editors/tinymce.php and search the line with this text:

$buttons2 = implode(',', $buttons2);

Now add this code before the line:

$plugins[] = 'tiny_mce_wiris';
$buttons2[] = 'tiny_mce_wiris_formulaEditor';  // For WIRIS Formula Editor
$buttons2[] = 'tiny_mce_wiris_CAS';            // For WIRIS CAS

The final code should look like:

…
$plugins[] = 'tiny_mce_wiris';
$buttons2[] = 'tiny_mce_wiris_formulaEditor';   // For WIRIS Formula Editor
$buttons2[] = 'tiny_mce_wiris_CAS';             // For WIRIS CAS

$buttons2 = implode(',', $buttons2);
…

4 Configure

Edit JoomlaRoot/media/editors/tinymce/jscripts/tiny_mce/plugins/tiny_mce_wiris/configuration.ini to set your own values. This table specifies all possible parameters.

5 WIRISpugins.js

Add WIRISplugin.js script. You can find more information here.

Note: In Joomla you need to include WIRISplugins.js in your template file. This file is located at /templates/<your-template-name>/index.php.

6 Check that the plugin works correctly

In order to check if the plugin is installed correctly, there is a page that makes some tests on your server. Open this link to see where is your test page.

7 Clean and backup WIRIS plugin for TinyMCE

Check this page.