Archive for the ‘MODx’ Category

MODx: Making Documents more Google Friendly

Thursday, October 23rd, 2008

In order to do that, create two Template Variables bound to your Template:
_ keywords
_ description
Then insert them in the head of your template:
Your can access them in your PHP code (maybe it could be useful in some snippet) like this:

$modx->getTemplateVar('metaKeywords', '*', $modx->documentIdentifier)

MODx: Plugin to Display Errors in a Development Environment

Thursday, October 23rd, 2008
// You need to set the Apache variable LIVE on your live server
$e = &$modx->Event;
switch ($e->name) {
   case "OnWebPageInit":
       if ( !isset($_SERVER['LIVE']) ) // development environment
       {
           error_reporting(E_ALL);
           ini_set("display_errors","1");
       }
       break;
   default:
       return; // stop here - this is very important.
       break;
}