Template Variables

Accessing from Snippets and Plugins

The value assigned to a template variable may be determined from within a snippet or plugin using code such as this :
// Get an array of all template variable values
global $modx;
$document_tvars=$modx->getTemplateVarOutput(true,$modx->documentIdentifier);
// Select the desired value
$value=$document_tvars['MyTemplateVarName'] ;