you can try
<?php
$chunk = $modx->getObject('modChunk', array('name' => 'SponsorEload' ));
var_dump($chunk->toArray());
?>
or
<?php
$chunk = $modx->getObject('modChunk', array('name' => 'SponsorEload' ));
print_r($chunk);
?>
Hey cipa,
It doesn’t crash the server but the browser. If you don’t do ->toArray() you will get a very very large object which is hundreds (maybe thousands) of lines long (i think it includes much of the XPDO class and MODX core class) because it all inherits eachother.
I hope this makes sence, but i have the same when i get any object and var_dump it

the text is just to big for the browser to display normally.
You should check out the file:
core/model/schema/modx.mysql.schema.xml
Search for templateVar and there you can see what you can use...
Here’s a little exerpt:
<object class="modTemplateVar" table="site_tmplvars" extends="modElement">
<field key="type" dbtype="varchar" precision="20" phptype="string" null="false" default="" />
<field key="name" dbtype="varchar" precision="50" phptype="string" null="false" default="" index="unique" />
<field key="caption" dbtype="varchar" precision="80" phptype="string" null="false" default="" />
<field key="description" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
<field key="editor_type" dbtype="int" precision="11" phptype="integer" null="false" default="0" />
<field key="category" dbtype="int" precision="11" phptype="integer" null="false" default="0" index="fk" />
<field key="locked" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" index="index" />
<field key="elements" dbtype="text" phptype="string" />
<field key="rank" dbtype="int" precision="11" phptype="integer" null="false" default="0" index="index" />
<field key="display" dbtype="varchar" precision="20" phptype="string" null="false" default="" />
<field key="display_params" dbtype="text" phptype="string" />
<field key="default_text" dbtype="text" phptype="string" />
<field key="properties" dbtype="text" phptype="array" null="true" />
<aggregate alias="Category" class="modCategory" local="category" foreign="id" cardinality="one" owner="foreign" />
<composite alias="TemplateVarTemplates" class="modTemplateVarTemplate" local="id" foreign="tmplvarid" cardinality="many" owner="local" />
<composite alias="TemplateVarResources" class="modTemplateVarResource" local="id" foreign="tmplvarid" cardinality="many" owner="local" />
<composite alias="TemplateVarResourceGroups" class="modTemplateVarResourceGroup" local="id" foreign="tmplvarid" cardinality="many" owner="local" />
</object>
I hope i helped you in the right direction
Found the solution in the forums
<?php
$parentId = $modx->resource->get(’parent’);
$tv = $modx->getObject(’modTemplateVar’, array(’name’ =>’ArticlesBanner’));
$value = $tv->getValue($parentId);
print_r($value);
?>