-
☆ A M B ☆
- 24,524 Posts
Those are the default properties. You can only delete properties you have created.
Thanks for your reply Susan!
I attach a screenshot to reference.
The properties listed on the right are properties i created ( to overwrite the default ones ).
I want to duplicate the property sets so i can work faster, but sometimes i need to delete some properties. As i said, i can´t do it. You mean that if i create a property that already is a snippet property, then i can´t delete it?
discuss.answer
-
☆ A M B ☆
- 24,524 Posts
No, those are not new properties that you have created. These are the default properties for the snippet, and their values can be modified but the properties cannot be deleted.
Very good, is there a bulk delete for default property set?
I duplicated a plugin, and started working extensively on it, with many events I don't wish to redo, and then went to the properties, only to see a bunch of inapplicable rubbish carried over during the duplicate.
I could just create a new plugin, but what the heck with the travail if there could possibly be a way to delete (100+) properties automatcially.
TinymceWrapper: Complete back/frontend content solution.
Harden your MODX site by
passwording your three main folders:
core, manager, connectors and renaming your
assets (thank me later!)
5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
Okay I just realized I could do that with SQL.
TinymceWrapper: Complete back/frontend content solution.
Harden your MODX site by
passwording your three main folders:
core, manager, connectors and renaming your
assets (thank me later!)
5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
I think this would also do it:
$snippet = $modx->getObject('modSnippet', array('name' => 'SnippetName'));
$snippet->set('properties', null);
$snippet->save();
If that doesn't work, this should:
$snippet = $modx->getObject('modSnippet', array('name' => 'SnippetName'));
$snippet->set('properties', array());
$snippet->save();
Okay, thanks, that works perfectly ( modified for my plugin).
I tried to re-engineer it to create a property set populated with values and whatnot, what a disaster!
Something like
$snippet = $modx->getObject('modPlugin', array('name' => 'myPlugin'));
$plugProperties = array(
'name' => 'My Setting One',
'description' => 'Description for setting one',
'type' => 'textfield',
'value' => 'value1',
'area' => 'area1'
);
$snippet->set('properties', $plugProperties);
$snippet->save();
I am just too lazy not to allow my slave computer do the task. And the json in the Database is pure gibberish, else I would have gone that route.
Any help would be most appreciated.
TinymceWrapper: Complete back/frontend content solution.
Harden your MODX site by
passwording your three main folders:
core, manager, connectors and renaming your
assets (thank me later!)
5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.