| sfFormExtraPlugin troubles [message #63684] |
Wed, 22 October 2008 18:52  |
jarod51 Messages: 79 Registered: May 2006 |
Member |
|
|
Hi
I can't manage to make sfWidgetFormTextareaTinyMCE work. Here is what i have done
1. install sfFormExtraPlugin -> cc
2. download and install tinymce to /web/js
3. configure the settings.yml rich_text_js_dir key to js/tiny_mce -> cc
4. in my form class i have inserted
$this->widgetSchema['last_name'] = new sfWidgetFormTextareaTinyMCE(
array('width'=>550,'height'=>350,'config'=>'theme_advanced_disable: "anchor,image,cleanup,help"'));
like in the example
and have this error
You must pass a "class" attribute for a TinyMCE widget (author[last_name]).
in SF_ROOT_DIR/plugins/sfFormExtraPlugin/lib/widget/sfWidgetFor mTextareaTinyMCE.class.php line 60
So i think it's just a matter of configuration, but i have tried several options and nothing seems to work 
Found answer: this error appears when you use the default generated form. It does not, when you replace it by
[Updated on: Wed, 29 October 2008 12:03]
|
|
|
| Re: sfFormExtraPlugin troubles [message #64122 is a reply to message #63684 ] |
Wed, 29 October 2008 12:01   |
jarod51 Messages: 79 Registered: May 2006 |
Member |
|
|
There is some kind of evolution.
The TinyMce editor is now in place... but empty.
In fact i'm trying to use it to display localized datas (with a embedi18n in my class form)
so i have declared the following in my xxxI18nForm class.
$this->widgetSchema['bio'] = new sfWidgetFormTextareaTinyMCE(
array(
'width' => sfConfig::get('app_tinymce_width',200),
'height' => sfConfig::get('app_tinymce_height',100),
'config' => sfConfig::get('app_tinymce_config',null),
'theme' => sfConfig::get('app_tinymce_theme','simple'),
),
array(
'class' => 'tiny_mce'
));
I have tried for fun to make a crud only for localized datas (xxxI18nForm), and it works ! TinyMce show up my content.
But in the context of localized embed datas (xxxForm) it does not work!
What am I doing wrong ?
|
|
|
|
|
|
| Re: sfFormExtraPlugin troubles [message #66209 is a reply to message #66202 ] |
Thu, 27 November 2008 23:37   |
bidule Messages: 47 Registered: November 2008 |
Member |
|
|
Edit: sorry, found the answer. Missing the javascripts definition in view.yml. Thanks a bunch, it works!
Thanks for the answer.
I'm not sure how to actually use this:
- I declared in settings.yml: rich_text_js_dir: js/tiny_mce
- I have unpacked tiny_mce in web/js/
- I setup the widget like this:
<?php $this->widgetSchema['objectives_en'] = new sfWidgetFormTextareaTinyMCE(
array(
'width' => 500,
'height' => 300,
'config' => 'theme_advanced_disable: "anchor,image,cleanup,help"',
'theme' => 'simple',
)); ?>
or any other option in config and theme, but no luck.
Javascript debugger says 'tinyMCE is not defined'.
Is there anything I'm missing?
[Updated on: Fri, 28 November 2008 00:12]
|
|
|
| Re: sfFormExtraPlugin troubles [message #90959 is a reply to message #66209 ] |
Thu, 07 January 2010 14:58  |
tkoomzaaskz Messages: 101 Registered: February 2008 Location: Poland |
Senior Member |
|
|
I'm afraid that the last post author doesn't need the solution any more, but maybe other symfony users will 
I just forced the same problem just a while ago. My browser js debugger printed out the same error. Using tinyMCE in sf 1.0 and >=1.2 is totally different. As far as I know,
rich_text_js_dir: js/tiny_mce
was used in sf 1.0. Now you need to download the js and put it anywhere in the $ web/ folder and read the js file as a very standard js file, which is putting the following code into any view.yml file:
javascripts: [ /js/tiny_mce/tiny_mce.js ]
If you have configured your widget as sfWidgetFormTextareaTinyMCE, everything is done!
Hope this helps someone.
symfony-world blog
|
|
|