From looking at the code briefly,
$idname is the numerical id of the tv, can also be an array of such
$fields are the fields you want, defaults to ’*’ so it will get all of them, you can leave this I guess
$docid allows you to specify a particular document, if you don’t, current document is used
$published allows you to specify if you want only published docs, this is the default.
it will return an array or false if it fails
The return value you want is ’default_text’ I think in the returned array.
Use MODx, or the cat gets it!
With this:
$bar = $modx->getTemplateVar("somevariable");
echo $bar[’value’];
I get the contents or ’value’. Now unfortunately the content is @INHERIT. That’s not what I want. I want it to be what it’s supposed to inherit...
In that syntax the name of the parametr becomes a var automatically. Therefore, in your example the &top=`` parameter can be accessed via the $top variable in the snippet code automatically.
So if you would simply echo $top; it should read the contents of the TV [*somevariable*]