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!
Okay, this solved. I see I can add conditions to the line 45 in the file
components.php
thanks
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
agreed with Matt... you might be able to get away with a comment in there as well:
Code:
<!-- empty component -->
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!
I think this should be default. If it has a title it should stay.