I think I’ll have to tell the editor to set the unpublish date manually.
So much to lean, not enough time to learn it!
Thanks.
Hi, I think you are on the right track and that post seems to be a good example to follow. I’ve not done much custom coding in Revo yet but a plugin associated to ’OnDocFormSave’ is likely the way to go.
Why not post your attempt here and we can have a look at it?
Quote from: lucas at Mar 18, 2011, 12:43 PM
I had a go at this as it seemed like a straightforward one to get started on.
Just aiming to set the Unpublish date to one day after the publish date:
<?php
// save new unpublish date into field
$update->set('unpub_date', $nupdate);
$update->save();
Try this:
<?php
// save new unpublish date into field
$resource->set('unpub_date', $nupdate);
// You shouldn't need this: $resource->save();
Quote from: lucas at Mar 23, 2011, 02:34 PM
Hi Bob, all works fine now. Thanks!
I take it that ’save()’ is not required because this occurs when the manager form ’save’ button is pressed anyway?
Right, the plugin code occurs between the button click and the actual save.
I am interested in doing something similar. When I set up the plugin with this code how do I have it run only for a select template?
Put this at the top:
if ($resource->get('template') != ##) {
return;
}
Replace ## with the ID of the template.