Re: FCK editor filling textarea with home page

2011-02-22 Thread WhyNotSmile
I found the solution to this.  The problem was that my site was in a
subdirectory, but the fck helper file was just pointing to the webroot
as if it was at the top level.  Adding in the subdirectory to the fck
basepath solved the problem.

i.e. in the fck helper, in the constructor, I had
  $this-BasePath = '/app/webroot/js/fckeditor/';
when it should have been
  $this-BasePath = /subdirectory'/app/webroot/js/fckeditor/';

Hope this helps someone else!

-- 
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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


FCK editor filling textarea with home page

2011-02-21 Thread WhyNotSmile
I'm using fck with CakePHP, on some admin pages.  I thought I'd done
what I've always done, but this time around, instead of seeing a blank
textarea in the admin form, I see a textarea which has the home page
in it - the full html.

I looked around, and found someone with a similar solution - they were
told to use '$this-layout = false;'.  There was no more detail, and
it didn't say whether it had worked.  I'm not sure how to do this to
try it out.  If I put it in the controller, I just get the form with
no formatting; the text box still has the home page in it!

Can anyone suggest what i could try here?  I've given my code below.

I really appreciate any thoughts.
Sharon

Controller code:

  function admin_add() {
   $this-layout = 'admin';
   $this-set('title_for_layout', 'Add Page');
   if(!empty($this-data)) {
if($this-Page-save($this-data)) {
 $this-Session-setFlash('Page Added To System', 'default',
array(class = success));
 $this-redirect('/admin/pages/index');
 exit();
}
$this-Session-setFlash('Please correct errors below', 'default',
array(class = error));
   }
  }


View code (admin_add.ctp):
   !-- Various divs  layout things go here - no php --
   echo $this-Form-create('Page', array('action'='add', 'admin'=1,
'class' = 'largeForm'));
   echo $form-label('Page Content');
   echo 'p class=helpEnter the page content/p';
   echo $form-label('nbsp');
   if(!empty($this-validationErrors['Page']['column1']))
$fck-Error = $this-validationErrors['Page']['column1'];
   echo $fck-Create('Page/column1');
   echo $this-Form-end('Add Page');
   !-- Various divs  layout things go here - no php --

-- 
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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php