Support from Acquia helps fund testing for Drupal Acquia logo

Comments

merlinofchaos’s picture

Status: Active » Closed (won't fix)

This won't be fixable until Drupal 6; getting javascript to work in the popups requires a mechanism that doesn't exist in Drupal 5. Sorry.

lourenzo’s picture

I've made it work, but it required a little hack that requires FCKEditor to be available.

Now, I'm trying to figure out how can it be reusable and support FCKEditor's absence, or even to deal with other WYSIWYG modules...

merlinofchaos’s picture

Depending upon where your hack is, you might try the module_exists function to test for the presence of FCK editor; if you need to test this in javascript, have it put something in the settings?

populist’s picture

I was able get WYSIWYG working with TinyMCE in a panel pane environment by doing a few modifications to the panel forms in form_alter. There are some limitations to the approach and it can be cleaned up a bit, but it can make it all happen in Drupal 5.x.

function my_module_form_alter($form_id, &$form) {
  switch($form_id) {
    case 'panels_edit_display':
      // Load a fake version of TinyMCE on the original page to get the javascript added
      $form['tinymce_hidden'] = array(
        '#type' => 'fieldset',
        '#attributes' => array('style' => 'display: none'),
      );
      $form['tinymce_hidden']['tinymce_prerender'] = array(
        '#type' => 'textarea',
      );
      break;
   
     case 'panels_content_config_form':
       // Modify the submit handler to save TinyMCE display to hidden textarea
       $form['next']['#attributes'] = array('onclick' => 'tinyMCE.triggerSave(true,true);');

       // Load a disable or enable link below each textarea
       global $user;
       $enable  = t('enable rich-text');
       $disable = t('disable rich-text');
       $user = user_load(array('uid' => $user->uid));
       $profile = tinymce_user_get_profile($user);
       $status = tinymce_user_get_status($user, $profile);
       $link_text = $status == 'true' ? $disable : $enable;
       foreach($form['configuration'] as $index_raw => $value) {
         $index = str_replace('_','-', $index_raw);
         if ($value['#type'] == 'textarea') {
           $form['configuration'][$index_raw]['#description'] .= "<div><a href=
\"javascript:mceToggle('edit-configuration-$index', 'wysiwyg4-configuration-$index');\" class=\"wysiwyg-editor\" title=\"edit-configuration-\"" . $index . "\" id=\"wysiwyg4-configuration-$index\">$link_text</a></div>";
         } else {
           if (is_array($value)) {
             foreach($form['configuration'][$index_raw] as $index2_raw => $value2) {
               $index2 = str_replace('_', '-', $index2_raw);
               if ($value2['#type'] == 'textarea') {
                 $form['configuration'][$index_raw][$index2_raw]['#description'] .= "<div><a href=\"javascript:mceToggle('edit-configuration-$index-$index2', 'wysiwyg4-configuration-$index-$index2'); \"  class=\"wysiwyg-editor\" title=\"edit-configuration-\"" . $index . '-' . $index2 . "\" id=\"wysiwyg4-configuration-$index-$index2\">$link_text</a></div>";
               }
             }
           }
         }
       }
      break;
  }
}
jkpro3’s picture

lourenzo: or anybody else

can you please share your hack for the panels pop-up window.. i need fckeditor to show up on the custom content pop-up but i can figure out how to do it.

Thanks in advance

melezhik’s picture

Version: 5.x-2.0-beta2 » 5.x-2.0-rc1a
Priority: Normal » Critical
Status: Closed (won't fix) » Postponed (maintainer needs more info)

lourenzo, should you please figure out how did you hack it?

It would be very fine for me to repeat your experience and make FCKeditor available for editing custom content for group panel pages...

mrfelton’s picture

is there a solution to this for D6/panels2 then?

yasir farooqui’s picture

Thanks Man, your solution worked for me, However I needed it to be done in D6, so I modified a bit. Here is the modified version for D6.

function mymodule_form_alter(&$form, $form_state, $form_id) {
		
		switch($form_id) {
		case 'panels_edit_display_form':
      // Load a fake version of TinyMCE on the original page to get the javascript added
      $form['tinymce_hidden'] = array(
        '#type' => 'fieldset',
        '#attributes' => array('style' => 'display: none'),
      );
      $form['tinymce_hidden']['tinymce_prerender'] = array(
        '#type' => 'textarea',
      );
      break;
  
     case 'ctools_custom_content_type_edit_form':
       
			 // Modify the submit handler to save TinyMCE display to hidden textarea
       $form['buttons']['#attributes'] = array('onclick' => 'tinyMCE.triggerSave(true,true);');

       // Load a disable or enable link below each textarea
       global $user;
       $enable  = t('enable rich-text');
       $disable = t('disable rich-text');
       $user = user_load(array('uid' => $user->uid));
       $profile = tinymce_user_get_profile($user);
       $status = tinymce_user_get_status($user, $profile);
       $link_text = $status == 'true' ? $disable : $enable;
       foreach($form['body'] as $index_raw => $value) {
				 $index = str_replace('_','-', $index_raw);
				 if ($value == 'textarea') {
				 	
           $form['body']['#description'] .= "<div><a href=
\"javascript:mceToggle('edit-body', 'wysiwyg4-edit-body');\" class=\"wysiwyg-editor\" title=\"edit-body-\"" . $index . "\" id=\"wysiwyg4-edit-body\">$link_text</a></div>";
         } else {
           if (is_array($value)) {
             foreach($form['body'][$index_raw] as $index2_raw => $value2) {
               $index2 = str_replace('_', '-', $index2_raw);
               if ($value2['#type'] == 'textarea') {
                 $form['body'][$index_raw][$index2_raw]['#description'] .= "<div><a href=\"javascript:mceToggle('edit-configuration-$index-$index2', 'wysiwyg4-configuration-$index-$index2'); \"  class=\"wysiwyg-editor\" title=\"edit-configuration-\"" . $index . '-' . $index2 . "\" id=\"wysiwyg4-configuration-$index-$index2\">$link_text</a></div>";
               }
             }
           }
         }
       }
      break;
  }
}
lord_of_freaks’s picture

Any solution for WYSWYG module in D6/Panels 2?????

yasir farooqui’s picture

Hey the solution I posted is for drupal 6 + Panels2 + tinymce. Do you want to know some thing else?

yasir farooqui’s picture

Hey the solution I posted is for drupal 6 + Panels2 + tinymce. Do you want to know some thing else?

yasir farooqui’s picture

Sorry guys , I noticed that my I posted the same post twice.

lord_of_freaks’s picture

Issue tags: +Panels2, +tinymce, +WYSIWYG API
function panels_tinymce_form_alter(&$form, $form_state, $form_id) {

	
	// Choose your Input format. I choose Filtered HTML (1)
	$format = 1;


	switch($form_id) {
		case 'panels_edit_display_form':
			 
			// Load a fake version of TinyMCE on the original page to get the javascript added
			$form['tinymce_hidden'] = array(
		        '#type' => 'fieldset',
		        '#attributes' => array('style' => 'display: none'),
					);
					$form['tinymce_hidden']['tinymce_prerender'] = array(
		        '#type' => 'textarea',
			);

			$profile = wysiwyg_load_profile($format);
			 
			wysiwyg_add_editor_settings($profile,$profile->settings['theme']);
			wysiwyg_load_editor($profile);

			break;

		case 'panels_content_config_form':
			
			// Modify the submit handler to save TinyMCE display to hidden textarea
			$form['next']['#attributes'] = array('onclick' => 'tinyMCE.triggerSave(true,true);');
			break;
	}
}
Dubber Dan’s picture

Hey Lorenzo, any chance of you posting your hack for FCKeditor?

If not then I guess I'll have to try the TinyMCE one instead.

dkruglyak’s picture

Version: 5.x-2.0-rc1a » 6.x-3.x-dev
Status: Postponed (maintainer needs more info) » Needs work

I suggest to consolidate separate TinyMCE / FCKeditor solutions into a single one based on WYSIWYG API module, intended as their replacement.

sun’s picture

Status: Needs work » Closed (duplicate)

On an attempt to save merlinofchaos from such issues...

Marking as duplicate of #356480: Lazy-load editors and #350035: Implement Drupal.detachBehaviors(). You can follow up on that issue to track its status instead. If any information from this issue is missing in the other issue, please make sure you provide it over there.

However, thanks for taking the time to report this issue.

Dubber Dan’s picture

The code by populist sounds promising, but I'm a little unsure where this code needs to be placed. Can anyone give some pointers?

Dubber Dan’s picture

There's a good explanation of the code to get TinyMCE working on D5 to be found at http://www.chapterthree.com/blog/matt_cheney/howto_use_tinymce_panel_pan...

ruloweb’s picture

FileSize
105.07 KB

I've made work the WYSIWYG module for panels 2 using the code below:

  foreach (filter_formats() as $format => $object) {
    if ($profile = wysiwyg_get_profile($format)) {
      wysiwyg_load_editor($profile);
      wysiwyg_add_plugin_settings($profile);
      wysiwyg_add_editor_settings($profile, 'default');
    }
  }

Im using it in the hook_init of a custom module, sure there is a better way such as runing the code just in the panel_content page.

I havent tested it on Panels 3 yet.

Hope it helps!

--
Jose Sanchez
http://www.deviancefactory.com/

recrit’s picture

drupal 6 + panels 6.x-3.0-beta2 + tinymce
This is a combination of the previous solutions with some tweaks.

function panels_tinymce_form_alter(&$form, $form_state, $form_id) {

  switch($form_id) {
    case 'panels_edit_display_form':
          // Load a fake version of TinyMCE on the original page to get the javascript added
          $form['tinymce_hidden'] = array(
              '#type' => 'fieldset',
              '#attributes' => array('style' => 'display: none'),
          );
          $form['tinymce_hidden']['tinymce_prerender'] = array(
              '#type' => 'textarea',
          );

          foreach (filter_formats() as $format => $object) {
            if ($profile = wysiwyg_get_profile($format)) {
              // wysiwyg_get_profile calls wysiwyg_load_editor

              // copied from wysiwyg.module
                $theme = wysiwyg_get_editor_themes($profile, (isset($profile->settings['theme']) ? $profile->settings['theme'] : ''));
                // Add plugin settings (first) for this input format.
                wysiwyg_add_plugin_settings($profile);
                // Add profile settings for this input format.
                wysiwyg_add_editor_settings($profile, $theme);
              // /copied from wysiwyg.module
            }
          }

          break;

    case 'ctools_custom_content_type_edit_form':
          // Modify the submit handler to save TinyMCE display to hidden textarea
          $form['buttons']['return']['#attributes'] = array('onclick' => 'tinyMCE.triggerSave(true,true);');
          break;

  } // /switch $form_id

}
recrit’s picture

amendment to previous post to handle panel pages also.

  switch($form_id) {
    case 'panels_edit_display_form':
    case 'panels_panel_context_edit_content':
          // Load a fake version of TinyMCE on the original page to get the javascript added
         ...
bensnyder’s picture

Ugh....

This is difficult.

@recrit: Do I make a custom module or put this code in template.php? Do I need to have my profiles configured a certain way in WYSIWYG module or simply have the libraries for TinyMCE installed?

Thanks ^_^. Please leave as little as possible up to the imagination.

recrit’s picture

WYSIWYG API + tinymce library
profiles do not have to be a certain way. This gets triggered on the panels edit form - if the user is privileged to select an input format that uses the WYSIWYG profile.

The above code needs to be put into a custom module.

david.a.king’s picture

recrit -

couldn't get this to work (no effect whatsoever) when putting it in a custom module with d6, panels 3.1, wysiwyg with tinymce - am i doing something wrong?

hefox’s picture

FileSize
1.2 KB

20, 21 in a module attached.

Works for me

pvanthony’s picture

Version: 6.x-3.x-dev » 6.x-3.2
Category: bug » task
Priority: Critical » Minor
Status: Closed (duplicate) » Needs review

This was the module that I really needed. It has solved many issues for me. You have really helped me.

Thank you, hefox, for sharing the module, panels_tinymce.

It works great with panels version 3.2.

Once again thank you very much for sharing this module.

P.V.Anthony

hefox’s picture

(Thank recrit, all I did was put it into appropriate files, zip+upload).

My suggestion is someone make it a module for now like imce wysiwyg bridge is a module or move over the issue to WYSIWYG issue queue.

bensnyder’s picture

Project: Panels » Wysiwyg
Version: 6.x-3.2 » 6.x-2.x-dev
Component: User interface » Code
Category: task » feature
Priority: Minor » Critical

It would be better to integrate it into the WYSIWYG module imo.

Moving it over :)

harking’s picture

Title: Textareas on the panels content ui doesn't support WYSIWYG editors like FCKeditor » Textareas on the Panels content UI doesn't support WYSIWYG editors.
Version: 6.x-2.x-dev » 6.x-2.0
FileSize
1.92 KB

I've made a new patch for WYSIWYG module. Applies to 2.0.

TwoD’s picture

Version: 6.x-2.0 » 7.x-2.x-dev
Priority: Critical » Normal
Status: Needs review » Closed (duplicate)

A patch like this is not likely to make it into wysiwyg.module itself. It's just a case-specific workaround for a more general problem, like sun mentioned in #16, this is a duplicate of #356480: Lazy-load editors.

Reverting/bumping version tag as patches should be made against the -dev versions, and new features are added to the highest version first. Released code is not touched again.
Changing to normal priority since other modules could also implement this workaround using their own hook_form_alter until the issue is fixed.

Danny_Joris’s picture

Thanks for the patch/module, Recit.

Is there a way to make this work with the ckeditor-module ?

If not, is there a way to make the WYSIWYG-module work in Panels with ckeditor? (or even fckeditor?)

Tnx.
Cheers,
Danny

recrit’s picture

I am not familiar with the ckeditor, so I am of little help there.
The code above accomplishes 3 things:

  1. create the form elements needed for the editor
  2. load the editor linked to each input format
  3. hook the form submit handler to save contents of all editors back into textareas

Since ckeditor does not use the WYSIWYG API, you would need to find equivalent ways to do all 3 in ckeditor.

sun’s picture

Quite some confusion here: Wysiwyg module supports CKeditor in the latest development snapshot (also 2.x)

recrit’s picture

@sun, thanks for the update. Didn't see it on the module page and haven't used editors for some time now.

To update my post:
you would just need the specifics for 1 and 3 above since 2 would be handled the same way with the Wysiwyg module.

ruloweb’s picture

FileSize
1.4 KB
75.57 KB

Hi all!

I created a module which make WYSIWYG module works with Panels :D. Im using it in a few sites and works awesome!

Please test it and let me know.

Do you think I have to create an official Drupal module? or this code has to be commited to WYSIWYG or Panels?

Thanks!

--
José Sánchez.
www.deviancefactory.com

ruloweb’s picture

Status: Closed (duplicate) » Needs review

You just have to enable it'll work.

Danny_Joris’s picture

FileSize
18.18 KB
14.23 KB

Hello Jose,

Thank you very much for sharing. However, when I enabled your module, I was unable to view/edit my existing panels-content, until i turned it off again. (examples in attachment)

Again thanks for sharing and I would love to test any versions of your module.

Cheers,
Danny

ruloweb’s picture

I've fix it. Now it's using the hook_init, I'll try to find a better place for it.

Thanks for testing!

--
José Sánchez.
www.deviancefactory.com

ruloweb’s picture

FileSize
1.42 KB

Attachment.

Danny_Joris’s picture

It works great for me, Jose!

Thank you very much.

Cheers,
Danny

spamwelle’s picture

thanks, Jose!

burtsbees’s picture

Status: Needs review » Closed (won't fix)

Hi. I downloaded your module and it works for panels when I create content. But if I go through site building, panel page, layout, and add new custom content, then I get nothing. The editor doesn't show up. I am trying to use wysiwyg and panels to create a custom homepage and this is the only way I know how.

sun’s picture

Status: Closed (won't fix) » Needs work
ruloweb’s picture

FileSize
1.7 KB

Hi all,

just added support for CKEditor and FCKEditor modules (sponsored by Danny_Joris).

Thanks!

--
José Sánchez.
www.deviancefactory.com

Zachary Oan’s picture

I get the same results that burtsbees gets in post #42, even with the new files so kindly provided in post #44.

Zack

lelizondo’s picture

subscribing

maxmatty73’s picture

subscribing

Cyberwolf’s picture

Subscribing.

willhowlett’s picture

subscribing

mrfelton’s picture

module at #44 works for custom content in panel nodes. Doesn't seem to work for the same in mini panels.

mrfelton’s picture

Attached patch adds support for mini panels to the module at #44. Works for me at least.

ianchan’s picture

subscribe

scotthoff’s picture

If the module works, you will be my hero.

harking’s picture

@josegabriel.st

If you feel up to it, please make an actual Drupal.org module until this functionality is rolled into the core of the wysiwyg module.

Thanks!

mrfelton’s picture

This is still not 100%. My patch at #51 made it work for mini panels. But it still doesn't work for Panel Pages (only panel nodes and mini panels)

scotthoff’s picture

It worked perfectly for me for what I was trying to do.

robbertnl’s picture

Works only for minipanels content here. I want to use the editor on a panel page as well.

robbertnl’s picture

FileSize
1.96 KB

Combined #44, #51 and added support for Panel Pages

mrfelton’s picture

Ok, so we're almost there with this one now. What's the plan - get it incorporated into WYSIWYG? Or create a separate module? I'm happy do the later if that is the route people want to take. Either way, I'd love to see this get moved out of this issue queue and somewhere more accessible.

Bezerik’s picture

Issue tags: +textarea
FileSize
1.91 KB

Hello all,

I updated the code from #58 and added support to "og_panels".

Especial thanks to hefox, harking, josegabriel.st, mrfelton, robbertnl and everyone who help's to build this module.

Greetings from barcelona!

lelizondo’s picture

+100 for a module. Even if it doesn't work for panel pages, remember there's 'alpha', 'beta', and 'dev'...

ruloweb’s picture

Hi all,

I'm commiting this into a Drupal module. I'll let you know when it's done.

Making some changes...

Sorry for the delay! Im gald this code helps you!!!

Thanks!

--
José Sánchez

robbertnl’s picture

I have got an issue on panel pages. Sometimes the popups in the ckeditor ('insert url' and 'insert image') doesn't accept keyboard input. Can somebody confirm this issue? Or, even better, fix this issue? :)

elviento’s picture

Version: 7.x-2.x-dev » 6.x-2.1

Same here with Drupal 6.17, Panels-6.x-3.5, and Wysiwyg-6.x-2.1.

Temporary work around is to use Ckeditor (confirmed with 6.x-1.1) and enable the module. Panels will default to Ckeditor in this instance.

(Sorry, it looks like somebody already found that 8()

mrfelton’s picture

@josegabriel.st - did you get it committed yet?

locomo’s picture

subscribe

jbylsma’s picture

FileSize
1.99 KB

Hopefully I'm not stealing anyone's thunder, but josegabriel.st's module request was turned down. You can see the discussion at http://drupal.org/node/803762. sun has a good synopsis in #4.

I've been using Bezerik's code from #60 for a while with TinyMCE/WYSIWYG and I've been pretty happy with it. The only issue I've encountered is when a user disables the wysiwyg ("Disabled rich-text") and tries to submit the form. I traced the problem back to the Drupal.wysiwygDetach call on line 8. The ajax submission attempts to detaches everything in Drupal.wysiwyg.instances, including wysiwygs that have already been detached. I've added a quick conditional check to see if the wysiwyg has been detached and to not do anything if it has been. I'm not sure if this issue only affects TinyMCE, but I figured it would be post back with the update for everyone.

Also, because of the somewhat nebulous status of the module, I've bumped up the version to 2.2, added version information in the info, and added a link to this node in the info. Hopefully that will help to minimize any future confusion! Thanks for all the hard work everyone else has contributed!

adugna17’s picture

Version: 7.x-2.x-dev » 6.x-2.1
Status: Closed (duplicate) » Needs work
Issue tags: +Panels2, +tinymce, +WYSIWYG API, +textarea

Thanks!!!

tallsimon’s picture

this is awsome I can see why they won't commit it to wysiwyg module as it is a specific work-around, but would love to see it as a contrib module - concerned if I install it, in the future I won't be able to work out where to get an update/file a bug report etc...

lelizondo’s picture

I don't see why this patch is not a module, the module is working. Yes, it might have some bugs, as every module has, and without an issue queue of its own is very difficult to report new bugs/issues.

The module is working for me with the exception of the bug mentioned in #67 by @jbylsma but that's something I can live without.

I don't want to be the bad guy here, I have a CVS account and I could create the module, but I also respect the members of the community, even if I don't share @sun's thoughts, I know he's an important and valuable member of the community and if he said no, I won't go against that, I've seen too many times stupid fights for stupid reasons and I won't be part of it.

There might be a solution after all: github

robbertnl’s picture

Good work #67. Didn't test it yet but i can verify this problem also occurs with CKEditor, so I will try this.

codewatson’s picture

#67 Seems to have been broken somewhat in the 3.7 release of panels. The editor loads fine, but on submit any changes are not saved, the only way to save the changes is to make them in the editor, then disable the editor, then submit the form. this is with wysiwyg 2.1/panels 3.7 and the module from #67.

thomasmuirhead’s picture

I'm also getting the same problem as in #72.

If I disable the rich text editor and type in some content, then save it it works. If I use the wysiwyg it won't save any changes.

lelizondo’s picture

Haven't tested #67 but it will harder and harder to follow and solve several bugs in just one single issue. Has anyone considered moving this small module to Github?

codewatson’s picture

So i'm trying to debug why this is now broken and i've traced it to possibly this part of the wysiwyg_panels.js line 29:

if ($(context).attr('id') == 'modal-content') {
    $('form:not(.ctools-use-modal-processed)', context).submit(Drupal.wysiwyg_panels.submitAjaxForm);
    $('.close').bind('mouseup', Drupal.wysiwyg_panels.submitAjaxForm);
  }

For some reason it looks like the IF statement does not come out true, which i haven't figured out why yet. This seems to prevent Drupal.wysiwyg_panels.submitAjaxForm from running which if i understand things correctly is what actually handles the wysiwyg detach stuff?

Anyone have any insight?

codewatson’s picture

Hmm well i dont know why this works but it seems if you comment out the if statement and just have the two lines contained within it everything works fine again...

Before:

if ($(context).attr('id') == 'modal-content') {
  $('form:not(.ctools-use-modal-processed)', context).submit(Drupal.wysiwyg_panels.submitAjaxForm);
  $('.close').bind('mouseup', Drupal.wysiwyg_panels.submitAjaxForm);
}

After:

//if ($(context).attr('id') == 'modal-content') {
  $('form:not(.ctools-use-modal-processed)', context).submit(Drupal.wysiwyg_panels.submitAjaxForm);
  $('.close').bind('mouseup', Drupal.wysiwyg_panels.submitAjaxForm);
//}

I really dont understand all the inner workings of what is going on between panels and wysiwyg and this module, but again, if the IF statement is left out the editor loads and saves just fine.

vkareh’s picture

FileSize
1.39 KB

Thanks for pointing me in the right direction! I've been trying to debug this since yesterday and based on your findings, I changed that snipped to the following:

if ($(context).attr('id') != '') {
  $('form:not(.ctools-use-modal-processed)', context).submit(Drupal.wysiwyg_panels.submitAjaxForm);
  $('.close').bind('mouseup', Drupal.wysiwyg_panels.submitAjaxForm);
}

It now works for me. I'm going to test some more use cases to make sure it's not screwing up anything else, but so far I haven't had any problems. This is using Panels 6.x-3.7, WYSIWYG 6.x-2.1 (with CKEditor 3.3.1.5586) and wysiwyg_panels_2.2.

codewatson’s picture

Yea i guess that's basically the same, i've also been updating the module to work with the in place editor and fixing mini panels support, still have to get the IPE to work for panel pages (it works fine for panel nodes atm).

codewatson’s picture

Arg.. Is there a simple way to test if the currently viewed page is a panel page?

codewatson’s picture

Well for now i've got it to work for everything but the IPE on Panel Pages.
Change this:

if ((arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == 'panel_content') 
	|| (arg(0) == 'admin' && arg(1) == 'build' && arg(2) == 'panel-mini' && arg(4) == 'edit-content') 
	|| (arg(0) == 'admin' && arg(1) == 'build' && arg(2) == 'pages' && arg(4) == 'operation' && arg(8) == 'content') 
	|| (arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == 'og_panels' && arg(4) == 'panel_content')) 
{

To this:

if ((arg(0) == 'node' && is_numeric(arg(1)) && user_access('use panels in place editing'))
	|| (arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == 'panel_content') 
	|| (arg(0) == 'admin' && arg(1) == 'build' && arg(2) == 'mini-panels' && arg(3) == 'list' && arg(5) == 'edit' && arg(6) == 'content') 
	|| (arg(0) == 'admin' && arg(1) == 'build' && arg(2) == 'pages' && arg(4) == 'operation' && arg(8) == 'content') 
	|| (arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == 'og_panels' && arg(4) == 'panel_content')) 
{
chriso’s picture

subscribe

that0n3guy’s picture

The above works pretty good for me with ckeditor, wysiwyg 2.1 and panels 3.7 for panel nodes.

With ckeditor, the mage button uses a modalframe popup thing which works pretty good except you cant type in any of the fields. You can right click and paste, but not type. Same with the link popup dialog thing. The "paste from word" popup lets you type in it though.

Anyone know how to get http://drupal.org/project/wysiwyg_imageupload modalframe thing to popup? Then this would be perfect for landingpages for my clients.

Here are some errors too look at.

Jon Nunan’s picture

I'm on the CTools & Panels Dev branches and something over the past couple of days seems to have broken the mini module provided here.

I'll start digging round.

jbylsma’s picture

I took lelizondob's advice and created a GitHub repository for this module. It is available at http://github.com/jbylsma/wysiwyg_panels.

I've also done some further work to the module. cTools 1.7 changed the selector that was passed for attachedBehaviors, which is why everything stopped working. vkareh's workaround, which just checked if the context object had a non-empty ID, did work, but I did some more work to make sure it was running on the actual modal container. I also tweaked how the close code was being applied and incorporated drwatson's conditional update (#80). If you'd like to see the rest, I've tried to be descriptive in my commits :)

I also can confirm that0n3guy's issue in #82 and added it as an issue on GitHub.

meatsack: I did some initial testing with my updated copy of wysiwyg_panels and the dev branches of ctools and panels, and everything seemed OK. Hopefully your issues will get resolved.

If I've done something dumb with GitHub, please cut me a little slack; I took some time last week to try and get accustomed with Git and GitHub, but I'm fairly fresh at all of this.

codewatson’s picture

Don't hold your breath but there could be native support for this soon in panels: #890824: Mini panels content doesn't save upon update (#7).

Jon Nunan’s picture

#84 @jbylsma, downloaded from your github rep and it does seem to be working again. Not sure if I had your version or someone else's originally.

Thanks!

adrianjacob’s picture

Hi all,

This is exactly what I have been wanting, and although it is working fine for panels, the wysiwyg editor doesnt show up for mini-panels. Am i missing something?

I am using:
Panels 3.7
Wysiwyg 2.1
Wysiwyg_Panels from github.

Ad.

codewatson’s picture

As far as i can tell it is working just fine with mini panels using the wysiwyg_panels from github. Perhaps you need to clear your cache and browser cache?

adrianjacob’s picture

Hi dwatson,

All caches are cleared.

It works/shows here:
/admin/build/mini-panels/list/[mini-panel-name]/edit/content

But just not here seemingly (creating new mini-panels):
/admin/build/mini-panels/add/content

Any ideas why?

A.

codewatson’s picture

Ah, i see, thats another url to check for then, change the condition part of the module to something like this (untested):

<?php
if ((arg(0) == 'node' && is_numeric(arg(1)) && user_access('use panels in place editing'))
    || (arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == 'panel_content') 
    || (arg(0) == 'admin' && arg(1) == 'build' && arg(2) == 'mini-panels' && arg(3) == 'list' && arg(5) == 'edit' && arg(6) == 'content') 
    || (arg(0) == 'admin' && arg(1) == 'build' && arg(2) == 'mini-panels' && arg(3) == 'add' && arg(4) == 'content') 
    || (arg(0) == 'admin' && arg(1) == 'build' && arg(2) == 'pages' && arg(4) == 'operation' && arg(8) == 'content') 
    || (arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == 'og_panels' && arg(4) == 'panel_content')) 
{
?>

this is the new condition:

|| (arg(0) == 'admin' && arg(1) == 'build' && arg(2) == 'mini-panels' && arg(3) == 'add' && arg(4) == 'content') 
elliotcapelo’s picture

Hi,

We can't get this to work with our panels. We have Panels 6.x-3.7, Wysiwyg 6.x-2.3, Chaos tools 6.x-1.7, tinymce 3.3.7 or fckeditor 2.6.6 (tried both but they neither of them work)

When I go to add a new panel and enter text in the teaser, the editor appears in the teaser and I can type the text in but when I click save it doesn't show up anything in the panel. if I click edit I can see the text again but not once I've clicked saved.

I can see this text however in the feed on the home page, just not on the page when i click on it. Same goes for adding new custom content in the panel, I can add the content but it doesn't appear.

Any idea what I've missed?

Cheers,

Fiona

elliotcapelo’s picture

We're having the same problem as #72 and #73 can write in the box in panels with the rich text editor disabled but it doesn't save it if we use the rich text editor.

Any ideas?

We have Panels 6.x-3.7, Wysiwyg 6.x-2.3, Chaos tools 6.x-1.7, tinymce 3.3.7 or fckeditor 2.6.6

codewatson’s picture

#92 and #93

Do you mean Wysiwyg Panels 6.x-2.3? There is no wysiwyg 6.x-2.3, that module is only on 2.1.

Did you download the wysiwyg_panels module from the github that is listed in #84?

elliotcapelo’s picture

Yes sorry I meant wysiwyg_panels 6.x-2.3 and wysiwyg 6.x-2.1 I have tried the wysiwyg with the editors in full HTML (where you set the editor in the wysiwyg module) with CKEditor 3.4.0.5825 and TinyMCE 3.3.7. This is only in full HTML and not using an editor with filtered HTML

I also tried the wysiwyg_panels from github which when I installed was at version wysiwyg_panels 6.x-2.2. But came up with the same result (shows when editing in panel, click save and content isn't saved, unless disable rich text editor)

Is there any other tools I need installed that are related to it? I have chaos tools installed version 6.x-1.7.

Thank you so much for your help!

elliotcapelo’s picture

Ok its working now thanks :-)

I had make sure ckeditor module wasn't enabled, for some reason it took a while for the changes to work after I disabled the module.

But working now and is a fantastic module! thanks

eigentor’s picture

FileSize
21.95 KB

I got it to work with Panels 3.7, Ctools 3.7, Wysiwyg 2.1 and CKeditor 3.4.

Though: When I open up say a link Popup, I cannot enter Text into the Textfields of CKeditor.

Dropdowns and everything else works.

codewatson’s picture

#96, you probably had to clear a cache somewhere after you uninstalled the ckeditor module, not sure, i dont use that one myself, good to hear it's working though.

#97, i think that is a known issue on the github issue queue: http://github.com/jbylsma/wysiwyg_panels/issues#issue/1

I can say that so far the tinymce editor is working like a champ with it so if you really need something that just works, you could switch to that

eigentor’s picture

Now I have another problem with panels_wysiwyg: I cannot get rid of it anymore.
Since It does not work reliably with CKeditor, I disabled the module and deleted it from my modules directory.

But I cannot stop something from rendering all custom Content Text areas in Panels with CKeditor.
It is still there. When I empty Drupal's cache it goes away for one time. But the next timee I edit
that pane again, the text area is rendered with CKeditor again.

I wonder where this gets stored? I deleted the entry in systems table, but this also does not help.

codewatson’s picture

You didnt happen to update panels to the dev version did you? I think they were adding support for the ckeditor in the next version without the need for an external module?

eigentor’s picture

Well meanwhile the Problem is kinda solved. I updated to the dev version, which allows for basic editing like Merlin states here: http://drupal.org/node/890824#comment-3366722. Though there are quite some issues for CKeditor, so happily waiting for the official version so I can post them ;)

mrfelton’s picture

Attached patch gets it working on mini panels clone too.

harking’s picture

xtfer has created a repo on github for this fix: http://github.com/jbylsma/wysiwyg_panels

Please fork with any future patches so we can keep it up to date :)

stefanp’s picture

Latest from github works fine for me on panels 1.7 and Wysiwyg 6.x-2.1 ! thanks!

bensnyder’s picture

As sun stated in http://drupal.org/node/803762#comment-2990660:

Truth is, it's impossible to properly tackle the referenced issue in Drupal 6. Only Drupal 7 will hopefully allow us to lazy-load JS/CSS on demand.

Shall we give 7.x a stab? +1

sun’s picture

Status: Needs work » Closed (duplicate)
Issue tags: -Panels2, -tinymce, -WYSIWYG API, -textarea

Thanks for taking the time to report this issue.

However, marking as duplicate of #356480: Lazy-load editors. You can follow up on that issue to track its status instead. If any information from this issue is missing in the other issue, please make sure you provide it over there.

slybud’s picture

Hi everyone,

I had the same issue on a fresh install : couldn't make TinyMCE appear in the mini-panel> pane editing modal.

Working with :

  • Pressflow 6.20
  • CToools 6.x-1.8
  • Panels 6.x-3.9 (and mini panels)
  • Wysiwyg 6.x-2.3
  • TinyMCE libraries 3.9.3
  • dozens of other modules that I hope won't interact in the described case above

I gave a try at the module on github listed in #103 and it works like a charm on my install.

Thanks to @harking and @xtfer then, though it's considered as a dirty hack !

alunyov’s picture

Thanks, lord_of_freaks!
That helped me to resolve same issue but for D7 + WYSIWYG 7.x-2.0 + Panels 7.x-3.0-alpha3.
removed this line, cause wysiwyg_load_profile doesn't exist for D7:

$profile = wysiwyg_load_profile($format);

To

$profile = wysiwyg_get_profile('full_html'); 

Note: my editor (TinyMCE) was assigned to 'full_html'

UPDATED: still issues with saving edited content in wysiwyg

Peter Majmesku’s picture

Category: feature » bug
Priority: Normal » Critical
Status: Closed (duplicate) » Needs work

subscribe

sun’s picture

Category: bug » feature
Priority: Critical » Normal
Status: Needs work » Closed (duplicate)
flyzi’s picture

Version: 6.x-2.1 » 7.x-2.1

I search a patch module for : drupal 7 + wysiwyg "7.x-2.1" + panels "7.x-3.0-alpha3"

I want to use wysiwyg when I add "new custom content" (panels).

Solutions ?

Thanks

webcultist’s picture

Version: 7.x-2.1 » 7.x-2.x-dev

I also look for a way to use wysiwyg editors in "new custom content" form.

TwoD’s picture

Please note that this issue is closed.
The main causes of the problems, and patches, can be found in #356480: Lazy-load editors and #350035: Implement Drupal.detachBehaviors(), as mentioned first back in #16.
We're targeting D7 first because a solution for D6 will require relying on other modules and/or significant hacks before it would be possible to load editor libraries via AJAX.

With the latest patch in #356480: Lazy-load editors, and the Core patch in #1287368: Drupal.settings.ajaxPageState.css gets overwritten it is now possible to get editors to show up correctly. We need reviewers and testers in those issues to confirm all situations are covered, so please join if you can.

rlmumford’s picture

Has there been any progress with this for Drupal 7. I'm happy to help out wherever needed.

Anybody’s picture

Information: A possibly real solution can be found here: http://drupal.org/node/356480#comment-5494486 (#91)

Perhaps this issue should be closed to avoid duplicates?

For the German users (and others of course who would like to use it), I've provided a temporary patched wysiwyg module download at:
http://julian.pustkuchen.com/drupal-7-wysiwyg-tinymce-panels-benutzerdef...
which I am using myself.
(As a short help for users who don't know how to patch, of course handle with care, it's just a reviewed patch!! See warning at the end of the blog post.)

MKorostoff’s picture

^^ @Anybody, this worked for me!

mw4ll4c3’s picture

*sorry double-post*

mw4ll4c3’s picture

Issue summary: View changes
Issue tags: -
FileSize
1.58 KB

With a little tweak, I was able to get WYSIWYG working for Custom Content panes in a Panelizer / Panels IPE environment. Strong text editing is obviously very critical in such cases! Thanks for the original code... best non-module ever :)

Be advised this tweak does not address node/%/panelizer/content, as

  1. No users will see it but me, on this site
  2. WYSIWYG does not appear to attempt to apply itself there
  3. It's one in the morning

The check could be tighter, but it works. See #3, above, and how ultimately harmless the worst-case outcome of a false positive is.

This simply adds the following function, and check its truth in the OR stack in wysiwyg_panels_init().

function wysiwyg_panels_check_panelizer() {
  if (module_exists('panelizer')
    && module_exists('panels_ipe')
    && (arg(0) == 'node')
    && is_numeric(arg(1))
    && (!arg(2))
    && user_access('use panels in place editing')
  ) {
    $node = node_load(arg(1));
    return panelizer_is_panelized('node', $node->type);
  } else return FALSE;
}