WebsiteBaker Support (2.8.x) > Modules

CKEditor: Change the height of the editor

(1/1)

CodeALot:
From ckeditor/wb_config/wb_config.js:


--- Code: ---   // The standard height and width of CKEditor in pixels.
    config.height           = '600';
    config.width            = '100%';

--- End code ---


Whatever I put there, it doesn't have any effect. Once I use the  "resize"-arrow at the lower-right corner, the width also jumps back to about 80% of the window.

Any suggestions? I think the standard height of CKEditor is way too small, that's why I want to change it...

jacobi22:

--- Quote ---Any suggestions? I think the standard height of CKEditor is way too small, that's why I want to change it..
--- End quote ---

the values from editor height & width comes from the editor-call in the modules

here an example from modules/wysiwyg/modify.php

<?php
echo show_wysiwyg_editor('content'.$section_id,'content'.$section_id,$content,'100%','258px', false);
?>

inside of the function show_wysiwyg_editor() it works at $height / $width
If no height or width defined in the editor-call, the function use the default height & width in the show_wysiwyg_editor() (modules/ckeditor/include.php)
you can change the height & width only with the changing of $height / $width in modules/ckeditor/include.php before this lines ( ~ Ln 360), maybe with this line 

--- Code: ---$height = '400px';
--- End code ---



--- Quote ---$ckeditor->config['height'] = $height;
$ckeditor->config['width']  = $width;
--- End quote ---

or with the changing of
$ckeditor->config['height'] &&  $ckeditor->config['width'] behind this lines


another solution is wysiwyg_admin (see attachement)
wysiwyg-admin is a admintool. you can change some base settings for the used wysiwyg editor like width, height, uicolor. you can also define here font and colors for the select-fields in the editor, so that the user can only select the defined font and font-colors (if he dont work in the source-code..)
the module works in former ckeditor-versions, but in the actual version, the order is a little bit wrong in modules/ckeditor/include.php, so, that wysiwyg_admin doesn't work for width & height, but i'll talk with dietmar about this, so he can change it for the next wb-version (i hope...)

but here a fix for it
cut off these line here in modules/ckeditor/include.php ~ Ln 360


--- Quote ---$ckeditor->config['height'] = $height;
$ckeditor->config['width']  = $width;
--- End quote ---

and move it ~Ln 333, before the script ask for the wysiwyg_admin_modul e. it start's with this line


--- Code: ---if (isset($database) && $ckeditor->wysiwyg_admin_exists ) {
--- End code ---

in this part, the script read the definitions from the wysiwyg-admin-module and write the config-keys new, but this will be overwritten from this two lines in the top

--- Quote ---$ckeditor->config['height'] = $height;
$ckeditor->config['width']  = $width;
--- End quote ---

you have also to activate the wysiwyg-admin-module in modules/ckeditor/include.php ~ Ln 156  (is deactivated  with a double slash in the front, remove this double slash)

--- Code: ---        $ckeditor->looking_for_wysiwyg_admin( $database );
--- End code ---

dont forget: if you change the width & height with the admintool wysiwyg_admin, it works globale in wb, that means: also the wysiwyg_editor in news module has then the new height & width.
P.S.: wysiwyg_admin doesnt work in the editor in WB-Options / WB_Settings, for this editor you have a own setting in DefaultTheme

Screenshot from WysiwygAdmin ->https://i.gyazo.com/eafd3f1570ddcb91e10f4279bf6e1411.png
Screenshot from the result -> https://i.gyazo.com/4c10a448ff10209155053c66e0864e69.png

CodeALot:
Thanks a million again. Problem solved! :-)  (Y) (Y)

Navigation

[0] Message Index

Go to full version