modxcms / revolution

MODX Revolution - Content Management Framework
https://modx.com/
GNU General Public License v2.0
1.35k stars 527 forks source link

Rich text editor plugin and contexts #11347

Closed sottwell closed 10 years ago

sottwell commented 10 years ago

Context settings do not work with RTE settings use_editor and which_editor. Other settings, such as publish_default and default_template, do work.

rtripault commented 10 years ago

Hi Susan,

Could you please give some more details about your configuration ? Tested use_editor and it worked as expected here (current develop branch), but i wasn't able to test with more than 1 RTE.

Thanks

sottwell commented 10 years ago

Ok, I have three RTEs, Ace, MarkItUp, and TinyMCE. I have two contexts, web and stylesheet.

I want the resources in web to use TinyMCE or MarkItUp, resources in stylesheet to use Ace. Ace is already used for elements.

To use Ace for resources, the use_rte has to be set to No.

So I began with System Settings: use_editor Yes, which_editor TinyMCE.

For the stylesheet context, I set use_editor No, which_editor Ace. I also tried any number of other settings. I also tried directly setting the web context settings. Different combinations result in all contexts using one RTE, the stylesheet context having no RTE, or both having no RTE.

The behavior seems to vary to some degree depending on which RTE I'm trying to use.

rtripault commented 10 years ago

Thanks for the description Susan,

My guess was right then, that's not a Revolution issue :smile:

Replace $modx->getOption('use_editor') by $modx->controller->context->getOption('use_editor') in the following lines and Ace should be able to handle context settings :

/cc @danyaPostfactum

sottwell commented 10 years ago

That makes a lot of sense. And (of course) it works great! Thank you!