Skip to content

Instantly share code, notes, and snippets.

@sepiariver
Created September 30, 2014 22:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save sepiariver/5975441f14340058d573 to your computer and use it in GitHub Desktop.
Save sepiariver/5975441f14340058d573 to your computer and use it in GitHub Desktop.
Custom Collections Image Renderer
var myimagerenderer = function(value, metaData, record, rowIndex, colIndex, store) {
if (value != '' && value != null) {
var baseUrl = MODx.config.collections_renderer_basepath_img;
if (value.indexOf('http://') === 0) {
baseUrl = '';
}
return '<div class="myimagerenderer"><img src="' + baseUrl + value + '" width="100"></div>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment