Hello all, how might I go about changing the default Resource Group when creating new resources in Modx?
I’d like a new resource group that I have created to be the default. I’m aware this may involve a core edit unless it can achieved with a plugin?
Any help greatly received.
A simple plugin tied to OnBeforeDocFormSave might do it:
if (if ($mode === modSystemEvent::MODE_NEW) {
$resource->joinGroup('MyResourceGroup');
}
If that doesn’t do it, I’m pretty sure this would -- connected to OnDocFormSave instead:
if ($mode === modSystemEvent::MODE_NEW) {
$resource->joinGroup('MyResourceGroup');
$resource->save();
}
Thanks Bob!
Is that Revolution code? I should have specified though I’m building this site on EVO 1.0.5.
Quote from: lokust at Jul 29, 2011, 05:12 AM
Thanks Bob!
Is that Revolution code? I should have specified though I’m building this site on EVO 1.0.5.
Sorry, I thought you were using Revo. It can definitely be done in Evo, but I don’t recall what the code would be.
locust, did you ever get this figured out for evo?
Thanks.