This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

My simple configuration for tinymce

Forum to discuss ExtJS and other JS plugins

My simple configuration for tinymce

by dhobson » Mon Feb 01, 2010 5:11 am

Just an example for people struggling with a rich text editor control
symfony version 1.2.10 (C:\wamp\bin\php\php5.2.5\PEAR\symfony)
tinymce: Version: 3.3b1

The form control that I wanted to use for the description field was originally setup like a simple edit control from symfony when it created the form and the classes like this in the BaseJobForm.class.php file

Code: Select all
'description'     => new sfWidgetFormInput(),


I needed to change it to work the way I wanted to use the control, like a rich text field, so I installed and configured tinyMCE.

I set this up in the JobForm.class.php file

Code: Select all
  public function configure()
  {
     // setup default sizes for job edit page sizes
     
     $this->widgetSchema['jobtitle']->setAttribute('size', 45);
     $this->widgetSchema['companyname']->setAttribute('size', 35);
     $this->widgetSchema['salary']->setAttribute('size', 35);
     $this->widgetSchema['email']->setAttribute('size', 35);
     $this->widgetSchema['phone']->setAttribute('size', 35);
     
     // How to configure TinyMCE with
     // http://forum.symfony-project.org/index.php/t/17614/
        //$this->widgetSchema['description'] = new sfWidgetFormTextareaTinyMCE();
   
    $this->widgetSchema['description'] = new sfWidgetFormTextareaTinyMCE(array(
      'width'  => 900,
      'height' => 350,
      'config' => 'theme_advanced_buttons1 : "cut, copy, paste, bold, italic, underline, justifyleft, justifycenter, justifyright , outdent, indent, bullist, numlist, undo, redo, link",
                   theme_advanced_buttons2 : "",           
                   theme_advanced_buttons3 : "",
                   theme_advanced_toolbar_location : "top",
                   theme_advanced_toolbar_align : "left",
                   theme_advanced_statusbar_location : "bottom",
                   theme_advanced_resizing: "false"
                   '),array('class' => 'tinyMCE',));
 
 }
dhobson
Member
 
Posts: 85
Joined: Sat Feb 10, 2007 5:04 pm
Location: Houston, Texas

Re: My simple configuration for tinymce

by Davidlg007 » Sun Feb 07, 2010 6:04 pm

Hi,
I've set up the TinyMce Rich text plugin, and it works perfectly,
but I don´t know how to display the rich Text generated.
I´ve tried it, and when I display the Rich text that was saved in the data base, it's displayed without format. Like this:

<p><strong>Hello World!!!!!!</strong> <span style="text-decoration: underline;"><em>This is a test</em></span>.</p>

What I can do to display this text well Formatted ?
Davidlg007
Junior Member
 
Posts: 2
Joined: Sun Feb 07, 2010 5:43 pm
Location: Madrid

Re: My simple configuration for tinymce

by dhobson » Tue Feb 09, 2010 10:10 pm

Please paste in your code that prints out the HTML. Rememeber to encapulate it in
Code: Select all
[CODE][/CODE]


Also, how do you know that the plugin worked perfectly if you can't show see the data in the correct form?
dhobson
Member
 
Posts: 85
Joined: Sat Feb 10, 2007 5:04 pm
Location: Houston, Texas