7913 Posts in 1355 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » SS 2.4 SimpleTinyMCEField defining style
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1139 Views |
-
SS 2.4 SimpleTinyMCEField defining style

4 August 2010 at 8:46pm Last edited: 5 August 2010 2:47pm
Seem impossible to define a style for SimpleTinyMCEField class
$fields->push( new SimpleTinyMCEField( 'ArticleContent', 'Article Content',
array(
'css' => 'mysite/css/style.css',
'insertUnorderedList' => true,
'copy' => true,
'justifyCenter' => false
),
28
) );
eveything inside the $config array is not considered----
I hope this help someone else that stumbles this problem I'm see that inside SimpleTinyMCEField constructor is missing something similar to:
if(!empty($config)) {
foreach($config as $k => $v) {
if($k == "css") $this->css = $v;
else if(array_key_exists($k, $this->controls))
$this->controls[$k] = $v;
}
}which is in SimpleHTMLEditorField, something that sets all the configurations from the $config param
in my code, before i push the SimpleTinyMCEField object I've set_default_content_css function and left the array empty
-
Re: SS 2.4 SimpleTinyMCEField defining style

27 September 2010 at 10:49am
The $config variable still doesn't seem to be fixed. In order to get my SimpleTinyMCEFields to use my theme's editor.css styles I put this in mysite/_config.php ...
SimpleTinyMCEField::set_default_content_css('themes/mythemename/css/editor.css');
$base = Director::absoluteBaseURL();
SimpleTinyMCEField::set_default_extra_options("body_class: 'typography', document_base_url:'$base'"); -
Re: SS 2.4 SimpleTinyMCEField defining style

8 November 2011 at 2:26am
I've also inserted the code posted above by Gene in my _config.php file and it works like a charm. Except for in Internet Explorer. After inserting the code, the "onclick" event of the SimpleTinyMCEField style select dropdown ceases to fire when it's clicked.
Right now I'm digging into the tinyMCE JavaScript files looking for a solution but haven't been able to find anything yet. Does anyone else have any ideas on how to solve this? I think it has something to do with the HTML for the "dropdown" menu not being created until the user clicks on the dropdown (and then it is dynamically inserted into the DOM). So I'd like to trigger that generation function straight after the DOM popup is finished loading, but can't figure out where the code with the function's name is...
| 1139 Views | ||
|
Page:
1
|
Go to Top |




