I did search before posting. Apologies is this is documented somewhere. However WYSIWYG appears to override the TinyMCE Page Break with the Drupal Teaser break. I need to allow clerical staff to insert page breaks when printing documents. This had been working.

How do I get the TinyMCE Page Break behavior back??

Thanks in advance.

Comments

twod’s picture

Title: Page Break replace by Teaser Break » Page Break
Category: bug » support
Status: Active » Fixed

Wysiwyg's Teaser Break plugin does technically not replace TinyMCE's page break plugin. We just didn't include official support for the page break plugin bundled with TinyMCE because Drupal core does not use or understand page break markers without additional modules.

Which module are you using for page breaks? Some of them, like Smart Paging for D7 includes their own plugin for adding manual breaks. If the module you're using doesn't, it's possible to inform Wysiwyg about the existing TinyMCE plugin by implementing hook_wysiwyg_plugin() the way it was done for FCKeditor in #801576: How To Create <!--pagebreak-->.

The needed module would look like this:
sites/all/modules/custom/custom.info:

name = Custom tweaks
description = Site specific tweaks, like enabling the Page Break plugin for TinyMCE.
core = 6.x

sites/all/modules/custom/custom.module:

/**
 * Implements hook_wysiwyg_plugin().
 *
 * Return an array of native editor plugins.
 *
 * Only to be used for native (internal) editor plugins.
 *
 * @see hook_wysiwyg_include_directory()
 *
 * @param $editor
 *   The internal name of the currently processed editor.
 * @param $version
 *   The version of the currently processed editor.
 *
 * @return
 *   An associative array having internal plugin names as keys and an array of
 *   plugin meta-information as values.
 */
function custom_wysiwyg_plugin($editor, $version) {
  switch ($editor) {
    case 'tinymce':
        return array(
          'pagebreak' => array(
            // A URL to the plugin's homepage.
            'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak',
            // A list of buttons provided by this native plugin. The key has to
            // match the corresponding JavaScript implementation. The value is
            // is displayed on the editor configuration form only.
            'buttons' => array(
              'pagebreak' => t('TinyMCE Page Break'),
            ),
            // Boolean whether the editor needs to load this plugin. When TRUE,
            // the editor will automatically load the plugin based on the 'path'
            // variable provided. If FALSE, the plugin either does not need to
            // be loaded or is already loaded by something else on the page.
            // Most plugins should define TRUE here.
            'load' => TRUE,
            // Boolean whether this plugin is a native plugin, i.e. shipped with
            // the editor. Definition must be ommitted for plugins provided by
            // other modules.
            'internal' => TRUE,
          ),
        );
  }
}

Enable the custom module and TinyMCE should have a new button to enable called "TinyMCE Page Break".

ashley.maher@didymodesigns.com.au’s picture

Henrik,

Thank-you that worked a treat!

Regards,

Ashley

Status: Fixed » Closed (fixed)

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