Posts: 25
Threads: 9
Joined: Jul 2010
How can I prevent a component to be deleted if there is empty content when clicking "Save Components"? The reason for this is that I don't want the "sidebar" component to be deleted, even if it's blank, to avoid confusion to the users.
Thanks!
Posts: 25
Threads: 9
Joined: Jul 2010
Okay, this solved. I see I can add conditions to the line 45 in the file
components.php
thanks
Posts: 82
Threads: 7
Joined: Dec 2010
Perhaps changing one of the core files is not the best solution? If you were to update GetSimple, this change would be lost anyway. Did you try inserting a space or html space entity ( 
into the component? No idea wether it would work or not, but it might be worth a try!
- Matt
Posts: 1,848
Threads: 86
Joined: Aug 2009
agreed with Matt... you might be able to get away with a comment in there as well:
Code:
<!-- empty component -->
-
Chris
Thanks for using GetSimple! - Download
Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Posts: 25
Threads: 9
Joined: Jul 2010
2011-08-31, 08:01:02
(This post was last modified: 2011-09-01, 12:56:46 by Horse riding.)
Thanks for the replies, I didn't want it get deleted automatically even if there aren't any contents. My clients won't be able to know about inserting
Code:
or
<!-- comment -->
So I've changed the condition from
Code:
if ( ($title[$ct] != null) && ($value[$ct] != null) ) {
to
Code:
if ( $title[$ct] != null ) {
so it will only verify the title, not the content, thanks!
Posts: 1,848
Threads: 86
Joined: Aug 2009
I think this should be default. If it has a title it should stay.
-
Chris
Thanks for using GetSimple! - Download
Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!