WYSIWYG is not displayed in panel pane popup

Events happening in the community are now at Drupal community events on www.drupal.org.
pyone's picture

WYSIWYG is working fine in other pages but it is not displayed in panel popup pane.
How can I make it display?

I use
Panel 6.x-3.9, TinyMCE editor
WYSIWYG 6.x-2.3
Drupal 6.

Comments

not sure if it can be done

gomezbl's picture

Hi, I had the same issue rencently also with TinyMCE; after struggling some time, I came to the conclusion that panels are being "thought" more to SHOW nodes than to EDIT them, right?. In my projects I use panels for the front-end and not to arrange the administration UI or editing nodes.

Anyone got what pyone asks for?

RafaBlanes
contacto@ellibronegrodelprogramador.com
Agile Drupal Development and more...

pyone may be referring to

decibel.places's picture

pyone may be referring to custom HTML pane component

I agree it is better to create a separate node with the HTML then place that node in the pane

FWIW most developers consider CKEditor superior to TinyMCE, which is the default wysiwyg for Joomla!

Solved

pyone's picture

Hi,

I found the solution at last. To display WYSIWYG editor in panel pane popup, it must be loaded in "panels editing page".
So, I added a hidden textarea which loaded WYSIWYG to that page in hook_form_alter of my custom module and it is working now.

if($form_id == 'panels_edit_display_form'){
$form['tinymce_hidden'] = array(
'#type' => 'fieldset',
'#attributes' => array('style' => 'display: none'),
);
$form['tinymce_hidden']['tinymce_prerender'] = array(
'#type' => 'textarea',
);
$form['tinymce_hidden']['format'] = filter_form();
}

Thanks.

Code

pyone's picture

<?php
if($form_id == 'panels_edit_display_form'){
$form['tinymce_hidden'] = array(
'#type' => 'fieldset',
'#attributes' => array('style' => 'display: none'),
);
$form['tinymce_hidden']['tinymce_prerender'] = array(
'#type' => 'textarea',
);
$form['tinymce_hidden']['format'] = filter_form();
}
?>

Mini panels

alemadlei's picture

In the case of mini panels, for my site, I had to also check form form "ctools_export_ui_edit_item_wizard_form"

Awesome! Pyrone's fix worked

zach harkey's picture

Awesome!

Pyrone's fix worked perfectly for me. Thanks.

Good to know!

gomezbl's picture

Seems to be a little bit tricky, but if it works...

Just a question, what about if you have in your site more than one panel page with form id to "panels_edit_display_form"?

RafaBlanes
contacto@ellibronegrodelprogramador.com
Agile Drupal Development and more...

More than one panel

pyone's picture

Hi,

Yes, there are more than one panel pages in my site. But I want WYSIWYG editor in every panel pane popup. So, this solution is OK for me.

Where do I add this PHP snippet?

dscarfer's picture

Hi,
Sorry to ask such a noob question. But in what file does this code go?

<?php
if($form_id == 'panels_edit_display_form'){
$form['tinymce_hidden'] = array(
'#type' => 'fieldset',
'#attributes' => array('style' => 'display: none'),
);
$form['tinymce_hidden']['tinymce_prerender'] = array(
'#type' => 'textarea',
);
$form['tinymce_hidden']['format'] = filter_form();
}
?>

Thanks in advance,
Dan

It should be in the function

cithukyaw's picture

It should be in the function yourmodule_form_alter(...) of your custom module.

With Regards,
Sithu