Hi,

First I would like to thank you for sharing your great work.

The module works just fine but, in my specific case, I need an extra feature :

I would like to allow "text format" for the textarea when I add/edit a template because the person who will create the templates is non-technical. So it will be more user-frendly to use ckeditor or any other Rich Text editor.

As the module doesn't allow this in it actual state, I tried to figure how to achive this by making some minor changes on the source.

Here is my changes :

In wysiwyg_template.admin.inc (~ line 122) :

$form['body'] = array(
    '#type' => 'text_format', // switch from 'textarea' to 'text_format'
    '#title'  => t('HTML Template'),
    '#rows'  =>  10,
    '#format' => NULL, // add this line
    '#default_value' => isset($form_state['values']['body']) ? $form_state['values']['body'] : '', 
    '#required' => true
  );

and in wysiwyg_template.module (~ line 313) :

/**
 * Wysiwyg template database save function.
 */
function wysiwyg_template_save_template($template) {
  $new_template = array(
    'name' => $template['name'],
    'title' => $template['title'],
    'description' => $template['description'],
    'fid' => $template['fid'],
    'body' => $template['body']['value'], // switch from "$template['body']" to "$template['body']['value']"
  );

After some tests, it seems to work fine for me.

Hope it could help someone with the same problematic.

P.S. : sorry for not display a patch file but I don't work with git for now, so I need some more practice to do so.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dexter0015’s picture

Hi,
Here is a patch.

guybedford’s picture

Status: Needs review » Closed (fixed)

Thanks for this, I've added it into the latest release.