Hi All,
Can anyone tell me if its possible and how to set a default resource group for a newly created resource to belong to in settings? I cant find any options to do this in Site/Context Settings.
Regards
Ash Finlayson
Anyone have an answer for this?
Maybe you could write a Plugin that allocates the resource to the resource group OnDocFormPrerender or similar.
Mike
I think you can use Form Customization to set a default value for the resource group field.
As thingstodo suggests, there's probably a way to do it with a plugin tied to OnDocFormPrerender,
or you could use a plugin tied to OnBeforeDocFormSave. I think this would work:
<?php
/* Default group plugin */
if ($mode === modSystemEvent::MODE_NEW) {
$modx->resource->joinGroup('resource_group_name_or_id');
}
Cheers guys, I hadn't realised a plugin could do the job. Sounds perfect
Ash
Duh. I forget to mention this (which I wrote):
DefaultResourceGroup.