22415 Posts in 6944 Topics by 2750 members
General questions about getting started with SilverStripe that don't fit in any of the categories above.
|Go to End|
5 March 2010 at 3:53am Last edited: 5 March 2010 4:13am
I'm creating a website where I'd prefer to have different WYSIWYG-Editor configurations for different user-groups. Apparently, the CMS already supports that, by allowing the admin to specify a "HTML Editor Configuration" in the "Security" > "Permissions" tab.
The CMS sees my configurations and also displays them in the dropdown. Everything seems to be saved just fine, but the CMS doesn't apply the settings. It always uses the default configuration.
Is there something I have to do myself here? Get the current user-group and apply it's editor config?
Any insight would be appreciated. Thanks
5 March 2010 at 4:12am
Figured it out.
Member->getHtmlEditorConfigForCMS() looks up the editor config to use.
It selects the best editor config based on priority.. so if you don't set a priority for your config, you will always end up with the default config.
The following solved the problem (default priority is 0):
6 May 2010 at 12:23am
Could you explain how you managed to get the result of your first post in this thread. How did you create a custom HTML Editor Configuration and where did you put it?
6 May 2010 at 7:00am
Sure. A good place to define these configurations is in _config.php. Here's an example:
// NORMAL CONFIG
// ADMIN CONFIG
// create a new config named "admin"
$cfg = HtmlEditorConfig::get('admin');
// set the name for the config dropdown
// set the config priority (must be bigger than 0)
// enable some of the required plugins for silverstripe
// @see /cms/_config.php for the default config!
$cfg->enablePlugins('media', '../../tinymce_ssbuttons', 'fullscreen');
// customize your buttons here.. similar to example above?
After doing so, you should be able to select the config for each Member-Group (in the Permissions tab).
I don't know, if this is all the same in 2.4 though. Didn't try it yet. Also have a look at /cms/_config.php and the HtmlEditorConfig class to get some pointers how this all works.
6 May 2010 at 8:35pm
I ended up with just overwriting the existing HTMLEditorConfig for a most simple WYSIWYG editor.
// Set custom TinyMCE configuration
HtmlEditorConfig::get('cms')->setButtonsForLine(1,'undo, redo, separator, cut, copy, pastetext, separator, ssimage, sslink, unlink, separator, fullscreen, advcode, formatselect');
9 November 2010 at 12:29am
I've just the same problem, but my solution doesn't change anything....
I just want to remove some buttons of the tinyMCE:
$cfg = HtmlEditorConfig::get('cms');
but there are still buttons in the third line and there is still the italic-button in the first
I would be very grateful for further assistance!
11 November 2010 at 2:10pm
Sry...i found my mistake!
Too much ' ... only one ' at the beginning and one at the end!
I'm so st***!
|Go to Top|