I have been wrestling with some textareas not becoming WYSIWYG when first viewing the page. I have tiny configured such that textareas should be WYSIWYG by default. For example, the 'log message' textarea in node/add/book will not enable without clicking the 'disable' link.

After a long long battle, I was able to get that textarea to enable by default *by changing its name*. WHen I changed from 'log' to 'alog' it worked immediately. Are there reserved names which interfere with tiny? Can anyone confirm this behavior on the node/add/book page?

Comments

moshe weitzman’s picture

furthermore, the 2nd textarea on the node/add/book page (now named 'alog') is in an 'advanced' style with lots of buttons. the first one is not. i have not defined any 'profile' or theme function.

richardb’s picture

I can confirm having the same issues. I just switched to having wysiwyg off by default, but a proper fix would be preferable of course.
I googled for this, and checked the tinymce forum, but couldn't find any info reserved names for textareas yet.

moshe weitzman’s picture

this issue mentions the exact same textarea. may be related: http://drupal.org/node/20089

matt westgate’s picture

The 'log' textarea is disabled by default (Yeah, I know this should be documented). That's because folks were reporting that they couldn't edit the log field since it's not tall and tinymce covers up the field entirely. This behavior can be changed by overriding the tinymce theme function below.

function theme_tinymce_theme($init, $textarea_name, $theme_name, $is_running) {
  switch ($textarea_name) {
    // Disable tinymce for these textareas
    case 'log':
    case 'img_assist_pages':
    case 'caption':
      unset($init);
      break;

    // Force the 'simple' theme for some of the smaller textareas.
    case 'signature':
    case 'site_mission':
    case 'site_footer':
    case 'settings][access_pages':
      $init['theme'] = 'simple';
      unset($init['theme_advanced_toolbar_location']);
      unset($init['theme_advanced_toolbar_align']);
      unset($init['theme_advanced_path_location']);
      unset($init['theme_advanced_blockformats']);
      unset($init['theme_advanced_styles']);
      break;
  }

  // Add some extra features when using the advanced theme.
  switch ($theme_name) {
    case 'advanced':
      $init['extended_valid_elements'] = 'a[href|target|name|title|onclick]';
      break;
  }

  // Always return $init; !!
  return $init;
}
matt westgate’s picture

This was fixed by reinstalling the module.

Anonymous’s picture

Anonymous’s picture

Leon Atkinson’s picture

Version: » 4.6.x-1.x-dev

Looks like we need a exception added for trackbacks, too. TinyMCE seems to add a BR tag that the trackbacks module doesn't like.

Anonymous’s picture

Anonymous’s picture

avolve’s picture

Anonymous’s picture

ahoeben’s picture

See this patch which fixes the trackback issue you mention

Anonymous’s picture

Status: Fixed » Closed (fixed)