Hi ajayre,
Of course it can be done, it’s MODx
You’ll need to do a SQL query that left joins the template variable content table to the site content table.
Here’s the example query (you’ll need to change the table prefix, tmplvarid value, and template id value to your desired values - check in your database tables what these need to be set to) and I’m just returning the content ID and template variable content, but you could tweak this to your needs.
SELECT `modx_site_content`.id, value
FROM `modx_site_tmplvar_contentvalues`
LEFT JOIN `modx_site_content` ON `modx_site_tmplvar_contentvalues`.contentid = `modx_site_content`.id
WHERE `modx_site_tmplvar_contentvalues`.tmplvarid =4
AND `modx_site_content`.template =6
Of course, you can use the MODx API to run this query, but I thought just showing the straight query might be better. If you need help with the code, then just post back.
Hope that helps, Garry