Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Prevent deleting component with empty content
#1
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!
Reply
#2
Okay, this solved. I see I can add conditions to the line 45 in the file

components.php


thanks Smile
Reply
#3
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 (&nbspWink into the component? No idea wether it would work or not, but it might be worth a try!

- Matt
Reply
#4
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!
Reply
#5
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:
&nbsp;

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!
Reply
#6
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!
Reply




Users browsing this thread: 1 Guest(s)