bunk58: thanks guys.. this is the best support ever!!!
this website did the trick
http://wiki.modxcms.com/index.php/DB_query_and_Placeholders
The reason I was the errors is because I don’t create the chuck with the same name.. doh..
Snippet code (php) - [[wp_links]]:
<?php
$output = ’’;//create variable for holding the output
$sql = $modx->db->query( ’SELECT * FROM `modx_wp_links` LIMIT 0, 1000’);//define the DB query, in this case the table is named ’tblprojects’, add WHERE AND etc. as needed
$resultArray = $modx->db->makeArray( $sql );//put it into an array
foreach($resultArray as $item)//go through each record in the array
{//start looping through the data array
$params[’link_id’]=$item[’link_id’];//set the placeholders, the $params sets the name of the placeholder, the $item is the field name from the DB table
$params[’link_name’]=$item[’link_name’];
$params[’link_url’]=$item[’link_url’];
$output.=$modx->parseChunk(’URLTpl’, $params, ’[+’, ’+]’);//define the chunk name and process the content, here it’s ProjectTpl which has the placeholders for the data
}//finish looping through the data array
return $output;//now return the output from the processed chunk
?>
Chuck: {{URLTpl}} -> chunk referred to in the snippet:
<h3>[+link_id+]</h3>
<p> [+link_name+]
[+link_url+]</p>
Add this chuck to my template:
[[wp_links]]
{{URLTpl}}
--------------------------------------
And drumroll.. data from the wordpress start showing up... yuppie!!!
now on to creating a local community site with restaurant reviews, map, guide ect.... this is sweet
did u mention you guys/gal here rock!!
-Tyler