Problems, need help? Have a tip or advice? Post it here.
17 posts Page 1 of 2
Nicedit doesn't fully work on my computer anymore. I can't set or remove links, insert images or edit HTML.

Newest Chrome/Firefox on Ubuntu 20.04.1 LTS.

Code: Select all
Uncaught TypeError: Cannot read property 'className' of null
    at classDef.construct (nicedit.js?v=20200116:1073)
    at new classDef (nicedit.js?v=20200116:24)
    at classDef.mouseClick (nicedit.js?v=20200116:1156)
    at HTMLAnchorElement.<anonymous> (nicedit.js?v=20200116:270)
Nicedit has been deprecated for quite sometime as CKEditor can now be used in repeatable-regions (which was the primary reason for introducing nicedit).

Please edit your relevant editable regions and change the type form 'nicedit' to 'richtext' (making sure to visit the modified template as super-admin for the change to persist).
Nicedit had the advantage, that it doesn't wrap everything with a <div>, which sometimes breaks the design i.e.
Code: Select all
<p class="hero_text"><cms:show text/></p>

Output nicedit:
Code: Select all
<p class="hero_text">Your are welcome<br>this is my house!

Output richtext:
Code: Select all
<p class="hero_text"><div>Your are welcome<br>this is my house!</div>


I am not sure, how I can solve this in CKEditor.
Hello,

You can set options in couch\includes\ckeditor\config.js
gem3 wrote: You can set options in couch\includes\ckeditor\config.js

That's correct, but I don't know, how to handle different setups for ckeditor. Sometimes I need just inline code (no block elements like <p>, <div> etc), sometimes I need block elements, too.
Hello,

Are these options what you are looking for?

config.enterMode = CKEDITOR.ENTER_BR;
config.shiftEnterMode = CKEDITOR.ENTER_P;

CKEDITOR.ENTER_P (1) – New <p> paragraphs are created.
CKEDITOR.ENTER_BR (2) – Lines are broken with <br> elements.
CKEDITOR.ENTER_DIV (3) – New <div> blocks are created.

https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html
Hi @ge
gem3 wrote: Are these options what you are looking for?


Thank you for the info, but how can I assign CKEDITOR.ENTER_BR for some editables and CKEDITOR.ENTER_P for the others? There is no parameter in richtext for pointing to different config.js:

https://docs.couchcms.com/tags-referenc ... htext.html
@SimonWpt, I wonder if this feature (a choice of <P> and <BR> per region) was available with Nicedit?
Could you please confirm?
KK wrote: @SimonWpt, I wonder if this feature (a choice of <P> and <BR> per region) was available with Nicedit?
Could you please confirm?


Nicedit had <br>, ckeditor had <p>. :)
Thanks.
So using config.enterMode = CKEDITOR.ENTER_BR; with CKEditor will make it just the same as nicedit.
I suppose that is what your original query was.
17 posts Page 1 of 2
cron