MODX Community

Add TinyMCE RTE to a field

Hi there!
I have been searching quiet a while but somehow cannot find an easy answer to this question:
I want to add the TinyMCE RTE bar with all the fonts/strong/italics/etc options to the description field.
Can someone tell me how to do that?
Could be me not searching well enough…
Best,
K

I believe the TinymceWrapper extra allows you to turn on/off rich text editing for the description field.

However, I suggest using the Rich Text Template Variable instead of adding rich text functionality to the description field. The description field is commonly used as value for the description meta tags, if the field contains HTML markup this might cause unwanted side-effects.

1 Like

Maybe this gist still works. You’ll have to replace “modx-resource-introtext” with “modx-resource-description” though.

<?php
// check "OnDocFormRender" event
$modx->regClientStartupHTMLBlock('<script>Ext.onReady(function() {
    if(MODx.loadRTE) MODx.loadRTE("modx-resource-description");
});</script>');
1 Like

thanks a lot @halftrainedharry and @joshualuckers I will take a look at those options! For the moment I will be careful because of the meta tags in the description and so on