pepebe
6/3/2015 - 10:05 AM

setup correct settings for static pdf resources in revo 2.2

setup correct settings for static pdf resources in revo 2.2

<?php
/*
mode	Either 'new' or 'upd', depending on the circumstances.
resource	A reference to the modResource object.
id	The ID of the Resource (even for new resources)

Saving Happens Automatically 
No need to run the $resource->save() method as that happens automatically. I don't beive this...

*/


// Log all available properties of the $resource
$modx->log(MODX_LOG_LEVEL_ERROR, print_r($resource->toArray(),true) );

// Get the page id
$id = $id;

if(!empty($_GET['template'])){
    $template = $_GET['template'];
}
else
{
    $template = $resource->get('template');
}


if($template == 31 || $template == 35){
    
        $resource->set('content_dispo',0);
        $resource->set('content_type',8);
        $resource->save();

}

return;