Author Topic: too few lines when switching CKEditor to none  (Read 1047 times)

Offline betra

  • Posts: 32
too few lines when switching CKEditor to none
« 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

Offline jacobi22

  • Posts: 5875
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: too few lines when switching CKEditor to none
« Reply #1 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
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline betra

  • Posts: 32
Re: too few lines when switching CKEditor to none
« Reply #2 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

Offline jacobi22

  • Posts: 5875
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: too few lines when switching CKEditor to none
« Reply #3 on: November 16, 2018, 03:27:43 PM »
pls give me the wb-version-nr

Wer nicht will, findet Gründe, wer will, findet Wege.

Offline jacobi22

  • Posts: 5875
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: too few lines when switching CKEditor to none
« Reply #4 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
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline betra

  • Posts: 32
Re: too few lines when switching CKEditor to none
« Reply #5 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

Offline jacobi22

  • Posts: 5875
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: too few lines when switching CKEditor to none
« Reply #6 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
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline DarkViper

  • Forum administrator
  • *****
  • Posts: 3026
  • Gender: Female
Re: too few lines when switching CKEditor to none
« Reply #7 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.
« Last Edit: November 16, 2018, 04:35:20 PM by DarkViper »
Der blaue Planet - er ist nicht unser Eigentum - wir haben ihn nur von unseren Nachkommen geliehen

"You have to take the men as they are… but you can not leave them like that !" :-P
Das tägliche Stoßgebet: Oh Herr, wirf Hirn vom Himmel !

Offline jacobi22

  • Posts: 5875
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: too few lines when switching CKEditor to none
« Reply #8 on: November 16, 2018, 04:49:35 PM »
da sag ich jetzt mal nichts dazu....
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline betra

  • Posts: 32
Re: too few lines when switching CKEditor to none
« Reply #9 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

Offline jacobi22

  • Posts: 5875
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: too few lines when switching CKEditor to none
« Reply #10 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
Wer nicht will, findet Gründe, wer will, findet Wege.