// OnDocFormRender event. Make sure it is set to execute after any other plugin that could effect the template, like InheritParentTemplate. To edit the plugin execution order, from the manager go to Resources > Manage Resources > Plugins > Edit Plugin Execution Order by Event link. That's it. It should now show images of all image TVs. To configure image size, copy the following text (no leading spaces): &w=Max width;int;300 &h=Max height;int;100 into the plugin configuration and change values to suit This sets style="max-width: ; max-height: " for the image If you don't configure w or h, the image will be fullsize but you can add a css rule rule div.tvimage img {...} to the Manager Theme ------------------------------------------------------------------- */ global $content; $template = $content['template']; $e = &$modx->Event; if ($e->name == 'OnDocFormRender' && ($template > 0)) { $site = $modx->config['site_url']; if (isset($w) || isset($h)) { $w = isset($w) ? $w : 300; $h = isset($h) ? $h : 100; $style = "'max-width:{$w}px; max-height:{$h}px'"; } else $style = ''; // get list of all image template vars $table = $modx->getFullTableName('site_tmplvars'); $result = $modx->db->select('name', $table, "type='image'"); $tvs = ''; while ($row = $modx->db->getRow($result)) $tvs .= ",'" . $row['name'] . "'"; $tvs = substr($tvs, 1); // remove leading ',' $output = <<< EOT EOT; $e->output($output); } // ?>