Summernote editor - how to modify?

This section is for posting questions which are not directly related to WYSIWYG Web Builder.
Examples of off topics: web server configuration, hosting, programming related questions, third party scripts.

Note that these questions will generally not be answered by the administrators of this forum.
Post Reply
mixextra
 
 
Posts: 99
Joined: Sat Mar 21, 2020 11:45 pm

Re: Summernote editor - how to modify?

Post by mixextra »

Hi,

I hope it worked permission set to Ecuador (GeoIP - "EC").

http://mixextra.sk/Test4/index.html

click - "Administrator"
Username: none
Password: admin

clik - "Edit"
try the changes

clik - "Save"
edited content will appear on click - "Content"


(Alternatively, if you have an optional vpn, you can log in from a server from the countries of Slovakia (SK) or the Czech Republic (CZ), these are enabled by default by the provider.)

have a nice day
User avatar
Bluesman
 
 
Posts: 1119
Joined: Mon Feb 01, 2016 5:43 pm
Location: Sweden
Contact:

Re: Summernote editor - how to modify?

Post by Bluesman »

mixextra wrote: Mon Aug 22, 2022 12:41 pm Hi,

I hope it worked permission set to Ecuador (GeoIP - "EC").

http://mixextra.sk/Test4/index.html

click - "Administrator"
Username: none
Password: admin

clik - "Edit"
try the changes

clik - "Save"
edited content will appear on click - "Content"


(Alternatively, if you have an optional vpn, you can log in from a server from the countries of Slovakia (SK) or the Czech Republic (CZ), these are enabled by default by the provider.)

have a nice day
That was better. The typefaces works also ok...? I am stunned. I checked your earlier settings and it seams to be same as mine when it comes to the fontlist. Do you have any other settings as CSS... I can not get it. Are the font installed on your server?

I did the test with Pablos example just as you did now and it seamed to work correctly. But it was after setting up my own design I started to modify the toolbar and fontlist.
The only difference in usage is that I use Layout grids for the design...
"Make My Day"

See my Website
mixextra
 
 
Posts: 99
Joined: Sat Mar 21, 2020 11:45 pm

Re: Summernote editor - how to modify?

Post by mixextra »

Hi Bluesman

he did a lot of tests before I was able to isolate the problem.enjoy the procedure:

This is the procedure that works for me with the SUMMERNOTE editor + the "CMS Admin" and "EditableContentAdmin" tools:

1.
Summernote generates """ characters when saving to the database. For example, we write the word "test" in the editor and select the font "Jost Black" and the size "14px".

summernote generates such code, which it writes to the database:

Code: Select all

<p><span style="font-family: &quot;Jost Black&quot;; font-size: 14px;">test</span><br></p>
and when retrieving the text from the database, it is not displayed correctly for the characters "&quot;"

before saving to the database it is necessary to replace "&quot;" for "one quote" so that the resulting code is:

Code: Select all

<p><span style="font-family: 'Jost Light'; font-size: 14px;">test</span><br></p>
I achieved this by adding "CMS Admin" or "EditableContentAdmin" to the php code after publishing to the server. Open "editablecontentadmin.php" or "cmsadmin.php" and find the line:

Code: Select all

$content = isset($_POST['content']) ? $_POST['content'] : '';
add the code under this line:

Code: Select all

$content = str_replace('&quot;', "'", $content);
and save changes.

Attention when publishing a new website to the server, it must be repeated!

2.
In the WWB project and in the "CMS Admin" or "EditableContentAdmin" element in the "Object Html/Before Tag" tab (CTR+H), it is necessary to complete the path for the used fonts, for example:

Code: Select all

<link href="NameProject.css" rel="stylesheet">
(I use not googleFonts in this case and add fonts to the server manually via WWB)
or

Code: Select all

<link href="https://fonts.googleapis.com/css?family=Raleway:400&subset=latin-ext&display=swap" rel="stylesheet"> 
(I use it for googleFonts)

I don't know why, but the summernote editor doesn't see the css style listed in the header of the website and it is necessary to add this path to "CMS Admin" or "EditableContentAdmin".

Always test on a device browser that does not have fonts installed in WIN or WWB
I'm not a programmer, I tested this procedure with mysql and json database. Works well and as expected.

Have a nice day.


Perhaps Pablo could advise:
1. how to add "$content = str_replace('&quot;', "'", $content);" directly in WWB so that "editablecontentadmin.php" or "cmsadmin.php" does not have to be rewritten every time after publishing to the server.

2. why Summernote does not see the css style listed in the website header
User avatar
Bluesman
 
 
Posts: 1119
Joined: Mon Feb 01, 2016 5:43 pm
Location: Sweden
Contact:

Re: Summernote editor - how to modify?

Post by Bluesman »

Thanks a lot mixextra, shall try to wrap my head around this. But good if we can address Pablo and see if he has a simpler solution to this issue...
I shall try to get him notice this :D
"Make My Day"

See my Website
User avatar
Bluesman
 
 
Posts: 1119
Joined: Mon Feb 01, 2016 5:43 pm
Location: Sweden
Contact:

Re: Summernote editor - how to modify?

Post by Bluesman »

mixextra wrote: Mon Aug 22, 2022 4:01 pm Hi Bluesman

he did a lot of tests before I was able to isolate the problem.enjoy the procedure:

This is the procedure that works for me with the SUMMERNOTE editor + the "CMS Admin" and "EditableContentAdmin" tools:

1.
Summernote generates "&quot;" characters when saving to the database. For example, we write the word "test" in the editor and select the font "Jost Black" and the size "14px".

summernote generates such code, which it writes to the database:

Code: Select all

<p><span style="font-family: &quot;Jost Black&quot;; font-size: 14px;">test</span><br></p>
and when retrieving the text from the database, it is not displayed correctly for the characters "&quot;"

before saving to the database it is necessary to replace "&quot;" for "one quote" so that the resulting code is:

Code: Select all

<p><span style="font-family: 'Jost Light'; font-size: 14px;">test</span><br></p>
I achieved this by adding "CMS Admin" or "EditableContentAdmin" to the php code after publishing to the server. Open "editablecontentadmin.php" or "cmsadmin.php" and find the line:

Code: Select all

$content = isset($_POST['content']) ? $_POST['content'] : '';
add the code under this line:

Code: Select all

$content = str_replace('&quot;', "'", $content);
and save changes.

Attention when publishing a new website to the server, it must be repeated!

2.
In the WWB project and in the "CMS Admin" or "EditableContentAdmin" element in the "Object Html/Before Tag" tab (CTR+H), it is necessary to complete the path for the used fonts, for example:

Code: Select all

<link href="NameProject.css" rel="stylesheet">
(I use not googleFonts in this case and add fonts to the server manually via WWB)
or

Code: Select all

<link href="https://fonts.googleapis.com/css?family=Raleway:400&subset=latin-ext&display=swap" rel="stylesheet"> 
(I use it for googleFonts)

I don't know why, but the summernote editor doesn't see the css style listed in the header of the website and it is necessary to add this path to "CMS Admin" or "EditableContentAdmin".

Always test on a device browser that does not have fonts installed in WIN or WWB
I'm not a programmer, I tested this procedure with mysql and json database. Works well and as expected.

Have a nice day.


Perhaps Pablo could advise:
1. how to add "$content = str_replace('&quot;', "'", $content);" directly in WWB so that "editablecontentadmin.php" or "cmsadmin.php" does not have to be rewritten every time after publishing to the server.

2. why Summernote does not see the css style listed in the website header
Hi again mixextra... happy friday :D
Now Pablo added the "

Code: Select all

$content = str_replace('&quot;', "'", $content);
" thanks to you, so now the menu works and keeps the font changes after saving and enter. After this I tested to turn off the fonts used in the windows system... then I don't get the right fonts in the menu... the names are there but get standare serif and sans-serif... And when I have the fonts activated in system it show correct in menu and viewpage but not on external pc:s ??
Which procedure must I do that you adviced above for achieve this? I'm using the "@font.face fonts" in my projects...

After some trial 'n error empty cashes etc seams to work now. One mistake I did though was to install the fonts I wanted in WWBs @font-face, but I didn't use the font in the project so it didn't install the font to the server... so now works...
"Make My Day"

See my Website
Post Reply