WebsiteBaker Community Forum

WebsiteBaker Support (2.11.x) => Modules => Topic started by: betra on November 16, 2018, 02:58:15 PM

Title: too few lines when switching CKEditor to none
Post by: betra on November 16, 2018, 02:58:15 PM
I have Website Baker Version 2.11.0.

When I switch the WYSIWYG Editor to none,
I get only 2 lines to edit my content.
Of course, by pulling it down with the mouse, the window size increases.
How can I get 20 lines by default?

Regards
Bernhard
Title: Re: too few lines when switching CKEditor to none
Post by: Gast on November 16, 2018, 03:09:29 PM
modules/wysiwyg/modify.php, search for this line

Code: [Select]
echo show_wysiwyg_editor('content'.$section_id,'content'.$section_id,$content,'100%','258', false);
and change 258 to the wished height. add there also px or % to have a correct value
Title: Re: too few lines when switching CKEditor to none
Post by: betra on November 16, 2018, 03:26:04 PM
Thank you for the answer.
But I switch the Wysiwyg editor off (to none) in Options.
There should be annother mini Editor instead.
Even your line 'echo show_wysiwyg-edi....' is not in my modules/wysiwyg/modify.php file.
I have a line: 'function show_wysiwyg_editor($name,$id,$content,$width,$height)'
but the $height Variable is not set in this file.

Regards
Bernhard
Title: Re: too few lines when switching CKEditor to none
Post by: Gast on November 16, 2018, 03:27:43 PM
pls give me the wb-version-nr

Title: Re: too few lines when switching CKEditor to none
Post by: Gast on November 16, 2018, 03:31:16 PM
Quote
But I switch the Wysiwyg editor off (to none) in Options.
There should be annother mini Editor instead.

No, that's wrong

there is only a simple text-area, not a mini editor
if you need a small editor, change the toolbar in modules/ckeditor/wb_config/wb_ckconfig.js to WB_Basic, WB_Simple or what ever you want
Title: Re: too few lines when switching CKEditor to none
Post by: betra on November 16, 2018, 03:34:18 PM
I have Website Baker Version 2.11.0.

I am content with a simple text-area, just want more than 2 lines.

Regard
Bernhard
Title: Re: too few lines when switching CKEditor to none
Post by: Gast on November 16, 2018, 04:18:45 PM
File:  modules/wysiwyg/modify.php

the originalcode in Lines 76 - 79
Code: [Select]
<?php
echo $admin->getFTAN()."\n";
show_wysiwyg_editor('content'.$section_id,'content'.$section_id,$content,'100%','350'false);
?>

change it to

Code: [Select]
<?php
echo $admin->getFTAN()."\n";
show_wysiwyg_editor('content'.$section_id,'content'.$section_id,$content,'100%','100px'false);
?>

important are the 100px here, maybe, you need only 80px

solution ist testet with WB 2.11.0
(https://i.gyazo.com/ca315c198e56e3c3b9134c9a8f6ca835.png)
Title: Re: too few lines when switching CKEditor to none
Post by: DarkViper on November 16, 2018, 04:18:47 PM
open the file /modules/wysiwyg/modify.php and replace the 'height' argument by 'rows="20"' (or even the numer of lines you wish).

        function show_wysiwyg_editor($name,$id,$content,$width,$height) {
            echo '<textarea name="'.$name.'" id="'.$id.'" style="width: '.$width.'; rows="20";">'. $content.'</textarea>';
        }

'height' is needed to reserve space for the CKEditor. A simple <textarea> needs the number of visible lines.

This solution gives you the freedom to switch in backend between Textarea and CKEditor (with original settings) at any time.
Title: Re: too few lines when switching CKEditor to none
Post by: Gast on November 16, 2018, 04:49:35 PM
da sag ich jetzt mal nichts dazu....
Title: Re: too few lines when switching CKEditor to none
Post by: betra on November 16, 2018, 05:33:28 PM
Thank you both.
I changed
echo '<textarea name="'.$name.'" id="'.$id.'" style="width: '.$width.'; height:.$height.';">'.$content.'</textarea>';
into
echo '<textarea name="'.$name.'" id="'.$id.'" style="width: '.$width.'; height: 500px;">'.$content.'</textarea>';

The change from
show_wysiwyg_editor('content'.$section_id,'content'.$section_id,$content,'100%','350', false);
into
show_wysiwyg_editor('content'.$section_id,'content'.$section_id,$content,'100%','500px', false);
works the same way.

Thank you very much
Bernhard
Title: Re: too few lines when switching CKEditor to none
Post by: Gast on November 16, 2018, 05:44:24 PM
the different between both solutions:

the solution from DarkViper (with the correct code  ;-)  ) works only, if no wysiwyg-editor is defined (set to NONE in wb-settings)
if you activate later the wysiwyg editor, he has the default height from the original code

my solution works also for a activated wysiwyg-editor, that means: with or without editor you have a textarea height from your defined value, for example 100px