This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » plugins » General plug-ins » sfFormExtraPlugin troubles
sfFormExtraPlugin troubles [message #63684] Wed, 22 October 2008 18:52 Go to next message
jarod51  is currently offline 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 Sad

Found answer: this error appears when you use the default generated form. It does not, when you replace it by

<?php echo $form ?>

[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 Go to previous messageGo to next message
jarod51  is currently offline 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 #64982 is a reply to message #63684 ] Tue, 11 November 2008 17:44 Go to previous messageGo to next message
Gorka  is currently offline Gorka
Messages: 23
Registered: February 2006
Junior Member
From what I have seen, the 'class' attribute refers to the id of the generated field. This should be why your TinyMCE editors appear blank, they don't find the element from which they must take their content.

I'm still trying to figure out why it should be necessary to provide the id of the field in the form class, but if you get any closer to the solution please let me know Smile
Re: sfFormExtraPlugin troubles [message #66201 is a reply to message #64982 ] Thu, 27 November 2008 22:45 Go to previous messageGo to next message
bidule  is currently offline bidule
Messages: 47
Registered: November 2008
Member
Did you get any luck with that? I'm greatly interested...
Re: sfFormExtraPlugin troubles [message #66202 is a reply to message #66201 ] Thu, 27 November 2008 22:54 Go to previous messageGo to next message
Gorka  is currently offline Gorka
Messages: 23
Registered: February 2006
Junior Member
Take a look at this:
http://trac.symfony-project.org/ticket/4918

I don't like the idea of patching things in an unsupported way, even less in beta or RC releases... but right now, it just works.
Re: sfFormExtraPlugin troubles [message #66209 is a reply to message #66202 ] Thu, 27 November 2008 23:37 Go to previous messageGo to next message
bidule  is currently offline 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 Go to previous message
tkoomzaaskz  is currently offline 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 Wink

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
Previous Topic:[solved] sfFacebookConnect for symfony 1.4
Next Topic:[SOLVED] sfWidgetFormJQueryAutocompleter: how to display model name in stead of id in edit form?
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software