I also had trouble using tinymce. I then tried yui's rich text editor and ran into a lot of styling issues and conflicts.
Finally I found ckeditor: http://ckeditor.com/. It works flawlessly for me and is very easy to integrate, like 4 steps total. 1. Just download and put the ckeditor folder into your webroot/js/ 2. Include a js link to the webroot/js/ckeditor/ckeditor.js file: $this->Html->script("ckeditor/ckeditor"); 3. Add the 'ckeditor' class to your textarea: $this->Form->textarea('fieldname', array('class'=>'ckeditor')); That's it, you can customize the tool bars on the editor by changing the ckeditor/config.js file, by doing something like so for just a very simple editor, or add more for a complex one: CKEDITOR.editorConfig = function( config ) { // Define changes to default configuration here. For example: // config.language = 'fr'; // config.uiColor = '#AADC6E'; config.toolbar = 'MyToolbar'; config.toolbar_MyToolbar = [ { name: 'basicstyles', items : [ 'Bold','Italic','Strike','-','RemoveFormat' ] }, { name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote' ] }, ]; }; On Nov 9, 7:30 am, ahmed fakher <[email protected]> wrote: > I have tried many times to use this plugin and I failed. I am > following documentation, but it does not work for me. I am posting the > simple code here, to know what wrong I am doing. > > 1-I put this plugin in this folder app/plugins > > 2- I add TinyMce helper to articles_controller > > <?php > > class ArticlesController extends AppController { > // good practice to include the name variable > var $name = 'articles'; > > // load any helpers used in the views > var $helpers = array('Html', 'Form','TinyMce.TinyMce'); > > /** > * index() > * main index page of the formats page > * url: /formats/index > */ > function index(){ > // get all formats from database where status = 1 > $articles = $this->Article->find("all") ; > > $this->set('articles', $articles); > > } > > function admin_add() { > // if the form data is not empty > if (!empty($this->data)) { > // initialise the format model > $this->Article->save($this->data); > > // set a flash message > $this->Session->setFlash('The Format has been saved'); > // redirect > $this->redirect(array('action'=>'index')); > } else { > // set a flash message > $this->Session->setFlash('The Format could not be > saved. Please, try again.','default', array('class' => 'flash_bad')); > } > } > > } > ?> > > 3- in the view file articles/admin_add.ctp I added the editor > > // i think the problem in this code > <?php $this->TinyMce->editor(array( > > 'theme' => 'advanced' > )); ?> > <div class="formats form"> > > <?php echo $form->create('Article');?> > <fieldset> > <legend>Add a article</legend> > <?php > // create the form inputs > echo $this->Form->input('title'); > echo $this->Form->input('content'); ?> > </fieldset> > <?php echo $form->end('Add');?> > </div> > > <ul class="actions"> > <li><?php echo $html->link('List Articles', > array('action'=>'index'));?></li> > </ul> -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
