-
☆ A M B ☆
- 24,524 Posts
You need to use groups and resource groups and access policies to control who can access what.
You could use a plugin to prevent given users or users in a given group from editing a resource with a given parent or template.
Oh, I do not mean to restrict acess for users. They should be able to acess the recources. I just want to be sure for these certain rescources, that users can not use a editor like tinymce, but are forced to edit plain text. Similar to like users or groups or even contexts can get override settings. But I dont want to set it globaly for a user, group or context, only for resources with childresources or templateoriented. All other resources should still be using tinymce
-
☆ A M B ☆
- 24,524 Posts
You can clear the "rich text" checkbox in the Settings tab of a resource.
And for this also you could use a plugin to stop the initialization of the rich text editor for resources with a given criteria, such as its template.
http://rtfm.modx.com/revolution/2.x/developing-in-modx/basic-development/plugins/system-events/onrichtexteditorinit
A plugin could be right.
Is the OnRichTextEditorInit Event fired right before the initialization?
And how to stop it? Can not find anything on that issue.
-
☆ A M B ☆
- 24,524 Posts
Neither could I; trial-and-error time!
[ed. note: sottwell last edited this post 11 years, 11 months ago.]
I would just clear the richtext checkbox and then use Form Customization to hide that field from the users.
-
☆ A M B ☆
- 24,524 Posts
Ok. Finally got something. Use OnDocFormPrerender, and
$resource->set('richtext', 0);
This is rather draconian, as it will kill the RTE for all fields. And some fiddling will be necessary to specify which resources to do this on. Also it doesn't work for new resources, as of course they cannot have a $resource object.
Thanx for your suggestions. But I dont see, that it fits my need for a treebranch or folder with no or restricted RTE also for newly created ressources. I now came up with a new context with own RTE settings. Not very elegant and complicated if cross context relations are needed.
discuss.answer
I think a some Form Customization rules, one setting the RT field default value, and one hiding that field, both with a constraint based on the parent or template might do it.