Here’s exactly what I’ve done to verify this.
1. Created a TV with a Data Grid output widget using this value (note the quote marks around the [+chunkid+] placeholder since this will be a string)
@SELECT * FROM [+PREFIX+]site_htmlsnippets WHERE name='[+chunkid+]'
2. Created a snippet that simulated using an array of values
$ids = array();
$ids['thischunk'] = 'sidebar1';
$modx->setPlaceholder('chunkid', $ids['thischunk']);
3. Put the snippet tags in a document, then the placeholder tags (just to check), then the TV tags.
I got the appropriate display, which varied according to the name I set in the snippet.
This is using using MODx 0.9.6.3 revision 4565, taken from SVN a few weeks ago.
The function in the tmplvars.commands.inc.php file for processing the @SELECT command:
case "SELECT" : // selects a record from the cms database
$rt = array ();
$replacementVars = array (
'DBASE' => $modx->db->config['dbase'],
'PREFIX' => $modx->db->config['table_prefix']
);
foreach ($replacementVars as $rvKey => $rvValue) {
$modx->setPlaceholder($rvKey, $rvValue);
}
$param = $modx->mergePlaceholderContent($param);
$rs = $modx->db->query("SELECT $param;");
$output = $rs;
break;
As you can see, it does use the $modx->mergePlaceholderContent function to merge any placeholders in the TV.