Thanks for all of your replies!!! I did get things working with the solution I posted earlier.
What I haven't quite figured out is how to turn the label off on the
replaced editor. I have CSS that puts an asterisk (*) after required fields
and it appears at the very bottom right after the editor window. Anyone
have any ideas on how to remove the label from that? I assume it's being
treated as a form field of it's own. I'm not as familiar with JS as I am
PHP and CakePHP.
I'm now having an issue with CSS and the JS replacement. I have CSS that
puts an asterisk (*) after required fields. This was actually generated by
cake and I liked it so kept it. However, I set the label to FALSE in
$this->Form->input(..., array('label' => false). This works, but it appears
that the JS replacement script is treated as a Form element and cake
includes the 'required' CSS class there. What I would like to know is if
there is a way to stop that.
Here is some code:
In the Form call:
echo $this->Form->label('body', null, array('class' => 'required'));
echo $this->Form->input('body', array('id' => 'body', 'class' =>
'ckeditor', 'label' => false));
The JS:
<script type="text/javascript">
var CustomHTML = CKEDITOR.replace( 'body',
{filebrowserBrowseUrl :
'/MyApp/app/webroot/js/ckfinder/ckfinder.html',filebrowserWindowWidth :
'1000',filebrowserWindowHeight : '700'}
);
</script>
The HTML of the display:
<div class="input textarea required"><textarea name="
data[Newsletter][body]" id="body" class="ckeditor" cols="30" rows="6">
<p>
To reiterate, the editor and filebrowser works just fine, but the JS
replacement doesn't respect the Form call 'label' => false.
Attached is a screenshot. Look below and to the left of the editor to find
the offending asterisk(*).
On Tuesday, May 1, 2012 8:17:03 AM UTC-4, vijay kumbhar wrote:
>
> Yes,
>
> Keep ckeditor inside js directory.
>
> You need to put the ckfinder inside the wwwroot directory.
>
> Create an element, ckeditor.ctp
> <?php
> echo $this->Html->script('/ckfinder/ckfinder', false);
>
> if(!isset($description)){
> $description = '';
> }
>
> echo $this->Form->textarea($name , array('label' => false , 'id' =>
> $id , 'value' => $description));//,'class'=>'ckeditor'?>
>
> <script type="text/javascript">
>
> //var siteurl = '<?php //echo FULL_BASE_URL;?>';
> //<![CDATA[
>
> // This call can be placed at any point after the
> // <textarea>, or inside a <head><script> in a
> // window.onload event handler.
>
> // Replace the <textarea id="editor"> with an CKEditor
> // instance, using default configurations.
> CKEDITOR.replace( '<?php echo $id;?>',
> {
> filebrowserBrowseUrl : '<?php echo FULL_BASE_URL;?>/ckfinder/
> ckfinder.html',
> filebrowserImageBrowseUrl : '<?php echo FULL_BASE_URL;?>/
> ckfinder/ckfinder.html?type=Images',
> filebrowserFlashBrowseUrl : '<?php echo FULL_BASE_URL;?>/
> ckfinder/ckfinder.html?type=Flash',
> filebrowserUploadUrl : '<?php echo FULL_BASE_URL;?>/ckfinder/
> core/connector/php/connector.php?command=QuickUpload&type=Files',
> filebrowserImageUploadUrl : '<?php echo FULL_BASE_URL;?>/
> ckfinder/core/connector/php/connector.php?
> command=QuickUpload&type=Images',
> filebrowserFlashUploadUrl : '<?php echo FULL_BASE_URL;?>/
> ckfinder/core/connector/php/connector.php?
> command=QuickUpload&type=Flash',
> width: '<?php echo $width; ?>',
> height: '<?php echo $height; ?>',
> contentsCss:['/css/global.css', '/css/ie7.css', '/css/jquery-
> ui-1.8.16.custom.css', '/css/slider.css', '/css/bootstrap.css', '/css/
> ie.css'],
> enterMode: CKEDITOR.ENTER_BR,
> ignoreEmptyParagraph: true
>
> }
> );
> //]]>
> </script>
>
> Use in view :
> <?php echo $this->Html->script(array('ckeditor/ckeditor', 'ckfinder/
> ckfinder')); ?>
>
> <?php echo $this->element('ckeditor', array('name' => 'body', 'id' =>
> 'body_eng', 'width' => 800, 'height' => 550)); ?>
>
> Hope this will help.
>
>
>
> On May 1, 11:32 am, hoss7 <[email protected]> wrote:
> > this is my sample code for wotk with ckeditor
> >
> > 1.copy ckeditor in "webroot/js"
> >
> > 2. in view :
> >
> > <?php echo $this->Html->script('ckeditor/ckeditor'); ?>
> >
> > <?php
> > echo
> >
> $this->Form->textarea('info',array('class'=>'ckeditor','id'=>'editor_office2003'));
>
>
> > ?>
> > </fieldset>
--
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
<<attachment: ckeditor-ckfinder.png>>
