Hello,
I would like to reopen this topic: https://toolset.com/forums/topic/wysiwyg-editor-in-custom-cell/
May I ask you, if someone found a solution of using wysiwyg editor in custom cell? I have same issue as JeremiB. Using wp_editor function causes disabled Visual tab. HTML tab works properly. Thanks in advance.
Hi, we never received any feedback from that other ticket's author, so I'm not sure if the solution we provided worked or not. Have you implemented the suggestion here?
https://toolset.com/forums/topic/wysiwyg-editor-in-custom-cell/#post-365054
I made same implementation like in example, but Visual editor is still disabled. I found maybe a reason of problem. When I click on Insert link (or on paragraph selector), on browser concole appears "Uncaught TypeError: Cannot read property 'rangeCount' of null". There is probably mistake in order of loading JS files in cbox. Can you recommend, how to enqueue scripts needed for TinyMCE?
Let me reach out to my 2nd tier support team for some additional insight here. I'll let them know the proposed solution does not work for you, and follow up with you when I get some feedback.
It seems, there is a relation between colorbox status (should be "oncompleted") and TinyMCE. Wp_editor should be called after complete load of colorbox. Is it reachable with layouts custom cells?
Hi, just a quick update to let you know I have passed your questions along and I am waiting to receive some feedback from our development team.
Hi Christian, I also need to use wysiwyg editor in custom cell - only HTML tab works properly.
Is there any solution?
Petr
Hello, is there any progress in this question? We shall to decide how to continue with toolset. This functionality is essential for us. Thanks in advance.
I'm afraid I don't have much more feedback to share at the moment. I have asked my 2nd tier support team for assistance and they have asked for more assistance from our development team, but we have yet to receive additional feedback.
Hi, I received some feedback from our developer overnight, and he has the following recommendations:
- Change the textarea ID and update the wp_editor function call to use the new ID
- Add the following scripts in PHP:
wp_enqueue_script('page');
wp_enqueue_script('editor');
add_thickbox();
wp_enqueue_script('media-upload');
wp_enqueue_script('word-count');
Thank you, but it doesn't work. Wysiwyg editor is still inactive, HTML editor works. There is still problem in combination of colorbox and wp_editor function. Can you give us a complete example of working custom cell with wp_editor. Thanks in advance.
Okay I'll relay your comments to the developer I am in contact with and update you when I have something to share.
Would it be possible for you to provide a Duplicator clone of your site? I would like to be able to show our developers what you have implemented so they can do some additional troubleshooting. I have enabled a private reply field here so you can share a link in confidence.
https://toolset.com/faq/provide-supporters-copy-site/
- When is the section-intro6b.php file included? In my local test, I used this code in functions.php:
add_action( 'init', 'theme_register_section_intro_init', 99 );
function theme_register_section_intro_init() {
if( class_exists( 'WPDD_Layouts' ) && !function_exists( 'include_ddl_layouts' ) )
{
function include_ddl_layouts( $tpls_dir = '' )
{
$dir_str = dirname(__FILE__) . $tpls_dir;
$dir = opendir( $dir_str );
while( ( $currentFile = readdir($dir) ) !== false ) {
if ( $currentFile == '.' || $currentFile == '..' || $currentFile[0] == '.' ) {
continue;
}
include $dir_str.$currentFile;
}
closedir($dir);
}
include_ddl_layouts( '/dd-layouts-cells/');
}
}
Then in section-intro6b.php I changed the init priority to 199 so it fires after the other init callback:
add_action( 'init', 'register_section_intro_init', 199 );
The WYSIWYG editor seems to be working as expected for me. I am able to use the dropdown menu to select different styles, I'm able to use Bold and Italics...am I missing something? Here is a screenshot.
Hi,
problem is when I try to edit custom cell again and WYSIWYG is disabled.
Thanks.