⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Is it possible to override default ckeditor settings



briggers
  • profile picture
  • Member

Posted 16 August 2013 - 10:58 AM

I've just started using Gorcery Crud and it's a brilliant tool.

 

I want to use different sized ckeditor boxes on different view templates. Some would need only a basic button set and 100-200px of height, others would have the full button set and 600-700px height.

 

I know how to define ckeditor parameters if I include it on a non GC page I create but I cannot see a way of telling CG to use a specific config or even how to tell it to use the 'textarea.mini-texteditor' defined in jquery.ckeditor.config.js

 

Can I override the default settings by including something in the view template itself?

 

Thanks for any help

Richard

 


davidoster
  • profile picture
  • Member

Posted 16 August 2013 - 15:58 PM

Hello and welcome to the forums [member=briggers].

Have you tried changing the value on grocery_crud.php under application/config to minimal?

Saying this though this is a global change.

Probably you will need to change via javascript the actual config values of the CKEditor, along with the required height.

Check here for the size.


briggers
  • profile picture
  • Member

Posted 17 August 2013 - 08:04 AM

Thanks for the idea David, but how can I include the call to that JS code in the template - or pass it to the template from my controller?

This is the code GC generates:

....
....
<div class='form-input-box' id="page_content_input_box">
					<textarea id='field-page_content' name='page_content' class='texteditor' ><h2>
	Welcome to XXX</h2>
<p>
	This is a page about us</p>
</textarea>				</div>
....
....

So I assume that the ckeditor id is also field-page_content

 

 

 

Richard


davidoster
  • profile picture
  • Member

Posted 17 August 2013 - 18:06 PM

All the output of your application when using Grocery CRUD is generated from your selected theme under assets/grocery_crud/themes/your_theme.

Research there what would be the best way of integrating this code for your particular needs.

There are many solutions to this, it just depends on your requirements.


briggers
  • profile picture
  • Member

Posted 19 August 2013 - 08:54 AM

Solved by including this at the end of the page:

<script type="text/javascript">
	CKEDITOR.config.width ='950px';
	CKEDITOR.config.height='600px';
</script>

Seems one can change lots of the config parameters on the page in this way.

 

Hope this helps someone else