This may show up most with someone who uses FCKEditor, but anything that operates on replacing (or excluding from replacing, in the case of FCKEditor) textareas by name would not be able to do so with the current textarea names used in Contemplate. The edit textarea for the Body template in Contemplate is called edit-body, which also happens to be the name of the textarea for entering, say, a new blog entry. So, I can exclude FCKEditor for Contemplate AND entering a blog entry (defeats the purpose of using a more advanced editor, since that's where I want it most) or neither, which makes Contemplate actually not work... the clickable links to enter fields into the text editor don't work (since the textarea is gone if FCKEditor replaced it) and the FCKEditor edit window ALWAYS populates with the default template, not any custom template that has been saved.

This should be a fairly simple change, I hope, with little risk. If the textareas were named something more Contemplate-specific, like maybe edit-body-template, it would allow for more flexibility in situations like mine.

Comments

FreeFox’s picture

I have the same problem. Would the use of another WYSIWYG editor help?

Thanks, Jan

ray007’s picture

Use of another WYSIWYG-editor would maybe help, since other editors may use other means to determine if to augment a text-area or not.
But:
1.) using the same id as all editable bodyfields for html content (id edit-body) is likely to also confuse other editors
2.) we have chosen fckeditor because we want to use this one, don't we?

The following little patch could help:

--- contemplate.module.orig     2007-01-17 15:54:05.050577000 +0100
+++ contemplate.module  2007-03-08 11:10:31.570498250 +0100
@@ -180,10 +180,10 @@
        '#type' => 'checkbox',
     '#title' => '<strong>'. t('Affect teaser output') .'</strong>',
     '#default_value' => CONTEMPLATE_TEASER_ENABLED & $template->flags ? TRUE : FALSE,
-    '#attributes' => array('toggletarget' => '#edit-teaser'),
+    '#attributes' => array('toggletarget' => '#edit-teaser-template'),
   );

-  $form['teaser']['teaser'] = array(
+  $form['teaser']['teaser_template'] = array(
     '#type' => 'textarea',
     '#title' => t('Teaser Template'),
     '#default_value' => $template->teaser ? $template->teaser : $default_teaser,
@@ -214,10 +214,10 @@
        '#type' => 'checkbox',
     '#title' => '<strong>'. t('Affect body output') .'</strong>',
     '#default_value' => CONTEMPLATE_BODY_ENABLED & $template->flags ? TRUE : FALSE,
-    '#attributes' => array('toggletarget' => '#edit-body'),
+    '#attributes' => array('toggletarget' => '#edit-body-template'),
   );

-  $form['body']['body'] = array(
+  $form['body']['body_template'] = array(
     '#type' => 'textarea',
     '#title' => t('Body Template'),
     '#default_value' => $template->body ? $template->body : $default_body,
@@ -383,7 +383,7 @@
   $flags |= $edit['teaser-enable'] ? CONTEMPLATE_TEASER_ENABLED : 0;
   $flags |= $edit['body-enable'] ? CONTEMPLATE_BODY_ENABLED : 0;
   $flags |= $edit['rss-enable'] ? CONTEMPLATE_RSS_ENABLED : 0;
-  return db_query('INSERT INTO {contemplate} (type, teaser, body, rss, enclosure, flags) VALUES ("%s", "%s", "%s", "%s", "%s", %d)', $edit['type'], $edit['teaser'], $edit['body'], $edit['rss'], $edit['enclosure'], $flags);
+  return db_query('INSERT INTO {contemplate} (type, teaser, body, rss, enclosure, flags) VALUES ("%s", "%s", "%s", "%s", "%s", %d)', $edit['type'], $edit['teaser_template'], $edit['body_template'], $edit['rss'], $edit['enclosure'], $flags);

 }
ray007’s picture

Nobody interested in this anymore or have I made an error in my patch?

rup3rt’s picture

subscribe