Post by Reptile » Wed Dec 02, 2015 7:21 am

Hi,

I'm working on a extension that uses the default summernote editor where you can put in your html stuff.
This works fine.
But when clearing the screen summernote keeps a default value of "<p><br></p>" if you look at the code.
This is saved in the database.
So the screen looks empty but it submits that piece of code to the database.

On the front page I use the code <?php if ($name) { ?>
But this won't work now as there is always a value.
So I cannot display anything when there is nothing put in on the admin page.

Does someone know a workaround?
It would really help me.

All my extensions: Click here or Click here


User avatar
Active Member

Posts

Joined
Mon Jan 30, 2012 7:23 pm
Location - The Netherlands

Post by OnNets » Wed Feb 10, 2016 4:18 pm

Hi Reptile,

In admin/view/javascript/summernote/summernote.js

Look for:

Code: Select all

emptyPara: '<p>' + blankHTML + '</p>',
Change it to:

Code: Select all

emptyPara: '',
That's it.

Regards,
onnets

New member

Posts

Joined
Wed Jan 06, 2010 5:53 pm

Post by jty » Sat Mar 19, 2016 7:50 am

@OnNets, I tried your solution but it didn't work on summernote.js. But it does work on the min file summernote.min.js
For newbies, if you switch to the .min file, you will also need to change header.tpl to call summernote.min.js

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by qahar » Sat Mar 19, 2016 2:15 pm

@reptile You can check with strip_tags

Code: Select all

if (strip_tags($name)) { ... } 

User avatar
Expert Member

Posts

Joined
Tue Jun 29, 2010 10:24 pm
Location - Indonesia

Post by Reptile » Mon Sep 12, 2016 10:26 pm

Thank you for the replies.
I will try them.

All my extensions: Click here or Click here


User avatar
Active Member

Posts

Joined
Mon Jan 30, 2012 7:23 pm
Location - The Netherlands
Who is online

Users browsing this forum: No registered users and 208 guests