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 » Javascript plugins » My simple configuration for tinymce
My simple configuration for tinymce [message #92630] Mon, 01 February 2010 04:11 Go to next message
dhobson  is currently offline dhobson
Messages: 85
Registered: February 2007
Location: Houston, Texas
Member
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

'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

  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',));
 
 }


Don Hobson
http://www.myonlinetown.com/index.php
http://www.stinkybathrooms.com/
Re: My simple configuration for tinymce [message #93041 is a reply to message #92630 ] Sun, 07 February 2010 17:04 Go to previous messageGo to next message
Davidlg007  is currently offline Davidlg007
Messages: 2
Registered: February 2010
Location: Madrid
Junior Member
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 ?
Re: My simple configuration for tinymce [message #93196 is a reply to message #93041 ] Tue, 09 February 2010 21:10 Go to previous message
dhobson  is currently offline dhobson
Messages: 85
Registered: February 2007
Location: Houston, Texas
Member
Please paste in your code that prints out the HTML. Rememeber to encapulate it in
[CODE][/CODE]


Also, how do you know that the plugin worked perfectly if you can't show see the data in the correct form?


Don Hobson
http://www.myonlinetown.com/index.php
http://www.stinkybathrooms.com/
Previous Topic:Telerik ASP NET for PHP
Next Topic:dynamic jQuery remote request
Goto Forum:
  

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