SOLVED.
I needed just something like that to generate a list in the TV when editing a resource.
@SELECT pagetitle, id FROM modx_site_content WHERE parent=[[++shop]]
Unfortunately this simple code doesn't work.
So the solution is:
TV input option
@EVAL $documentId = $modx->resource->get('id'); return $modx->runSnippet('getCheckboxes',array('documentId' => $documentId, 'option' => 'shops'));
Snippet getCheckboxes
<?php
$doc = $modx->getObject('modResource', $documentId);
if ($doc) {
$contextKey = $doc->get('context_key');
$modx->switchContext($contextKey);
$resId = $modx->getOption($option);
}
$output = $modx->runSnippet (
"getResources" , array(
"tpl" => "checkboxTpl",
"parents"=> $resId,
"limit"=>"80",
"depth"=>"0",
"sortby"=>"menuindex",
"sortdir"=>"ASC"
)
);
return $output;
Thank you very much Bob and Sottwell!