Elxis CMS Forum

Support => Elxis 4.x/5.x DEV => Topic started by: perseas on February 28, 2020, 17:29:33

Title: Bug ? : Text Formating on Elxis 5.0
Post by: perseas on February 28, 2020, 17:29:33
I'm trying to format a single row or a single paragraph by selecting it, with style text-align center in the Elxis 5.0 text editor.
The result is instead of the selected line or paragraph, formatting the entire text of all the document and tagging each paragraph of the document with style text-align center.
The same issue happens when I choose header formatting with <h1> or other tag <h3>.
To my surprise it not happens on the jodit text editor presentation site at https://xdsoft.net/jodit/play.html
Is it a bug ? It happens only to my site ?

I love Elxis but I miss the previous text editor (CKEditor) and especially:
- Pasting content from Microsoft Word
- Default Text Formats
- Custom Text Format Definition with custom Elxis classes (Styles)
- White background of preview html code

My CMS now is Elxis 5.0 which I like and it's simple to manage and functional, but for text Formatting I use the text editor from another site with Elxis 4.6 and i copy and paste the html code to the text editor of Elxis 5.0.
Title: Re: Bug ? : Text Formating on Elxis 5.0
Post by: michalis1984 on February 28, 2020, 19:12:12
I'm trying to format a single row or a single paragraph by selecting it, with style text-align center in the Elxis 5.0 text editor.
The result is instead of the selected line or paragraph, formatting the entire text of all the document and tagging each paragraph of the document with style text-align center.
The same issue happens when I choose header formatting with <h1> or other tag <h3>.
To my surprise it not happens on the jodit text editor presentation site at https://xdsoft.net/jodit/play.html
Is it a bug ? It happens only to my site ?

I think it happens only to your site. I tried but for me has the expected behaviour, only the selected text is getting the styling class.
Title: Re: Bug ? : Text Formating on Elxis 5.0
Post by: datahell on February 29, 2020, 10:41:28
Most probably you select the whole text and not the desired paragraph. To make sure you select the proper element use the tags shown in editor's left bottom corner. However using inline CSS should be avoided. It is old-fashioned method and and all recommendations are against it. Use CSS classes instead. A paragraph should be displayed as it is defined by your template's CSS. If you want to enter centered text use a div with the "elx5_center" class.

<div class="elx5_center">Anything here</div>

You can apply additional CSS classes to the above code. For example to add vertical space:
<div class="elx5_vspace elx5_center">Anything here</div>

To make the background color gray:
<div class="elx5_bg_lightgray elx5_vspace elx5_center">Anything here</div>

To add a red border:
<div class="elx5_border_red elx5_bg_lightgray elx5_vspace elx5_center">Anything here</div>

DON'T COPY-PASTE TEXT FROM WORD! The generated html is rubbish and you harm your site. Paste it into pspad/notepad and then copy-paste it in editor in order to get style-free text. The editor will generate your paragraphs, you need nothing else.
Title: Re: Bug ? : Text Formating on Elxis 5.0
Post by: perseas on March 03, 2020, 17:07:27
Thanks @michalis1984 @datahell for your answers.
Obviously the problem was caused by pasting text from the word but I can't do otherwise.
There was no problem with previous versions of elxis before upgrading the site to elxis 5 with the new editor.
I must use the text editor from another site with elxis 4.6 and paste the code into the site editor with Elxis 5.
The texts published in every article on my Elxis site are huge with thousands of words and dozens of paragraphs and are pre-formatted into words by another department of my company. As an administrator I only have to publish them as they are formatted and not formatted by the administrator.
The text editor is the top tool in the CMS for an administrator.
So I would ask in a future upgrade of Elxis 5, if technically possible, to create a second option for the administrator to be able to use a text editor compatible with "Pasting content from Microsoft Word" such as CKEditor.
Title: Re: Bug ? : Text Formating on Elxis 5.0
Post by: datahell on March 03, 2020, 18:59:50
Jodit editor has clean html plugin built in which gets displayed automatically when you try to copy-paste text from word. See attached screenshot.
Note: In Elxis 5.1 Jodit has been updated to version 3.3.24.

CKEditor is not an option for Elxis (https://ckeditor.com/pricing/).

Try to find an other editor with the features listed below and you will understand why we picked Jodit.

I dont say that Jodit is the best editor out there, I say that it is our best option for Elxis.
Title: Re: Bug ? : Text Formating on Elxis 5.0
Post by: perseas on March 03, 2020, 19:12:31
Yes I have already worked it. In the current version with a clean paste leaves some trash (picture). The new version of (Jodit Editor v.3.3.23) running on https://xdsoft.net/jodit/play.html seems to leave nothing behind. Will this be the case with the new version of Elxis 5.1 ??
Title: Re: Bug ? : Text Formating on Elxis 5.0
Post by: datahell on March 03, 2020, 19:32:57
Yes, Elxis 5.1 uses version 3.3.24 (even newer than the xdsoft.net site as I updated it once more a few days ago).

Note: no editor generates perfect html when pasting from word. The goal is to have as good html as possible. After paste I advise you to switch to html mode, check the generated html and perform manual clean up where needed. I understand that not all users have html knowledge but in order to have a perfect site you need to have some basic html/css/js knowledge.
Title: Re: Bug ? : Text Formating on Elxis 5.0
Post by: perseas on March 03, 2020, 19:35:16
Okay Datahell
Thanks for your always helpful tips.
Title: Re: Bug ? : Text Formating on Elxis 5.0
Post by: seadhna on March 05, 2020, 13:44:14
I can't figure out how to apply a class to an element with Jodit editor. Usually I just code, but a non-techie is asking me how to do it with the editor. I have googled and searched the Jodit website but I can't find this simple action - can you help? https://xdsoft.net/jodit/
Title: Re: Bug ? : Text Formating on Elxis 5.0
Post by: datahell on March 08, 2020, 12:29:26
Only by switching the editor in html mode you can do that.