New TinyMCE Editor (w/ bug fixes!)

0

Finally, we've unlocked how to add the WP TinyMCE editor to Pods! Below are the instructions on how to do this until we release it to the public. Obviously, this code currently doesn't make the form work in Pod::publicForm() but it does set up the TinyMCE Editor in the Pods Manage Content interface via WP Admin. I'll add some more code soon that will show it via publicForm()

This all includes the latest bug fixes after some of you helped test it out!

  1. In /wp-content/plugins/pods/init.php, add this code to the bottom:<pre>add_filter('admin_head','pods_multilang_tinymce');

function pods_multilang_tinymce() { wp_admin_css('thickbox'); wp_print_scripts('jquery-ui-core'); wp_print_scripts('jquery-ui-tabs'); wp_print_scripts('post'); wp_print_scripts('editor'); add_thickbox(); wp_print_scripts('media-upload'); if (function_exists('wp_tiny_mce')) wp_tiny_mce(); // use the if condition because this function doesn't exist in version prior to 2.7 }</pre> 2. Remove this line from /wp-content/plugins/pods/core/manage_content.php:<pre><script type="text/javascript" src="<?php echo $pods_url; ?>/js/nicEdit.js"></script></pre>

3. Replace this code from /wp-content/plugins/pods/core/input_fields.php:<pre>/*

Textarea box

*/ elseif ('desc' == $coltype) { ?> <textarea class="form desc <?php echo $name; ?>" id="desc-<?php echo $name; ?>"><?php echo $value; ?></textarea> <?php }</pre> With:<pre>

/*

Textarea box

*/ elseif ('desc' == $coltype) { ?> <textarea class="form desc <?php echo $name; ?>" id="desc-<?php echo $name; ?>"><?php echo htmlspecialchars($value); ?></textarea> <script type="text/javascript"> <!-- tinyMCE.init({ theme : "advanced", skin:"wp_theme", mode : "exact", elements : "desc-<?php echo $name; ?>", width : "100%", height : "250", theme_advanced_toolbar_location:"top", theme_advanced_toolbar_align:"left" }); --> </script> <?php }</pre> 4. Go to /wp-content/plugins/pods/core/manage_content.php and replace this code:<pre>function saveForm() { for (i = 0; i < elements.length; i++) { nicEditors.findEditor(elements[i].id).saveContent(); }</pre> With this:<pre>function saveForm() { tinyMCE.triggerSave(true,true);</pre>

asked Mar 2 '10 at 9:09

sc0ttkclark

2936

Im trying to add quickShop product using tiny with pods, it doesnt get added?, works on pages and post thou... any ideas? you help you be great! – michaelworks Apr 2 '11 at 5:01
add comment
enter at least 15 characters

16 Answers

1

This is not working for me at all. I just get a standard textarea. And as someone else mentioned, it messes up my edit page/post editors by adding for example advanced. to all the formats...

@volomike, I take valid XHTML any day over clean look (which you can still achieve very easyily with TinyMCE) ...

To be completely honest, I can't use Pods (which I really would like to) for my clients' websites, until the editor is changed to one that does valid XHTML.

answered Mar 2 '10 at 9:09

fatfred

11

add comment
enter at least 15 characters
0

BUG FIX!!! Links are getting replaced with ../ instead of the domain it was linked to. The fix is using this code on step 3:<pre>/*

Textarea box

*/ elseif ('desc' == $coltype) { ?> <textarea class="form desc <?php echo $name; ?>" id="desc-<?php echo $name; ?>"><?php echo htmlspecialchars($value); ?></textarea> <script type="text/javascript"> <!-- tinyMCE.init({ theme : "advanced", skin:"wp_theme", mode : "exact", elements : "desc-<?php echo $name; ?>", convert_urls : false, width : "100%", height : "250", theme_advanced_toolbar_location:"top", theme_advanced_toolbar_align:"left" }); --> </script> <?php }</pre>

answered Jul 27 '09 at 12:20

sc0ttkclark

2936

add comment
enter at least 15 characters
0

Works for me! Thanks!

answered Jul 27 '09 at 2:36

jonahcoyote

18

add comment
enter at least 15 characters
0

Unfortunately, I'm getting problems with this. Yes, these code changes do let me use TinyMCE with Pods, but at the same time, it ruins the dialog boxes for TinyMCE Advanced on the 'Edit Page' page.

For example: http://www.creativesports.co.uk/rob/smlpoole/tinymce-advanced-dialogue.png

The problem is in the changes that we're making in init.php. I'm not sure how to fix it though.

Does anyone have any idea of a solution?

answered Sep 9 '09 at 3:13

Rob Barrett

1

add comment
enter at least 15 characters
0

@sc0ttkclark - any chance you could make TinyMCE as an input helper?

answered Sep 9 '09 at 4:08

logikal16

249

add comment
enter at least 15 characters
0

@ctiggerf - I had that issue too, the best I could do so far was to just get the editor itself working. I'll eventually get into getting the rest going.

@logikal16 - I'll look into making this an input helper :-)

answered Sep 17 '09 at 2:43

sc0ttkclark

2936

add comment
enter at least 15 characters
0

Beware, I encountered several problems after going through these steps installing TinyMCE Editor. The same thing occured after deciding to give it a fresh start. I still encountered the same problems.

  • Any "date" column created will not appear the calendar onclick when adding an item.
  • The code column appears as a pick column when adding an item.
  • If more than 1 file upload column is in a pod, the second column completes itself with the same value as the first file column when adding an item.

answered Sep 27 '09 at 4:02

Bransin

6

add comment
enter at least 15 characters
0

I prefer nicEdit to TinyMCE. It's thinner and has less mess to go through to fix things. I was glad to see that Pods uses nicEdit by default.

However, while on that topic, nicEdit inside Pods has some quirks. For instance, randomly nicEdit wants to show me a 100px width. I refresh and it displays properly. Also, the font menu is cut off, and the "http" in the Add Image dialog is cut off where I only see the tops of each character. (Note I'm using FF3 on Ubuntu Linux, but I've also seen some of these problems on Windows Vista in the various browsers like IE, Opera, Safari, Chrome, and FF.)

answered Oct 4 '09 at 7:03

volomike

33

add comment
enter at least 15 characters
0

Thanks for that code. Is the plan for Pods in the future to move to TinyMCE as the editor of choice?

Also, if I patch my Pods plugin with this code, what would you recommend as the best way to prevent a new Pods update from blowing it away? Or will the next official update contain these patches anyway?

answered Oct 5 '09 at 3:44

morgan

1

add comment
enter at least 15 characters
0

Regardless of which editor is the default, both will be available.

One way to preserve Pods from overwriting local changes is to disable the plugin update check. http://wordpress.org/extend/plugins/disable-wordpress-plugin-updates/

answered Oct 5 '09 at 10:54

logikal16

249

add comment
enter at least 15 characters
0

Hi... has anybody tried this with the latest version of pods? It doesn't seem to work on later versions at all. Which makes me want to cry like a little girl. Any ideas?

answered Dec 3 '09 at 5:33

coeurmechante

28

add comment
enter at least 15 characters
0

I'm working on a new revision of this, and so far my testing is working out greatly. I'm getting an issue related to multiple editors on the same page though, I've posted it to the WordPress Trac:

http://core.trac.wordpress.org/ticket/11862

answered Jan 11 '10 at 3:38

sc0ttkclark

2936

add comment
enter at least 15 characters
0

@scott & @logikal: i´m (still) completely with @volomike. could tinymce stay as input-helper package or might you think about offering an option to choose between nicedit/tinymce?

answered Jan 11 '10 at 10:59

kaiiser

-129

add comment
enter at least 15 characters
0

@sc0ttkclark Is this issue with the editor in general, or with WP 2.9.1 ?

answered Jan 13 '10 at 4:38

Jim Isaacs

1

add comment
enter at least 15 characters
0

WP 2.9.1 definitely

answered Jan 14 '10 at 12:00

sc0ttkclark

2936

add comment
enter at least 15 characters
0

it isn't working anymore in the newest version of Pods with the newest version of Wordpress, am I right?

The textbox doens't appear, (the menu do) and the bottons doesn't do anything.

answered Feb 25 '10 at 9:48

Kazimi

1

add comment
enter at least 15 characters