Created
September 30, 2014 22:59
-
-
Save sepiariver/5975441f14340058d573 to your computer and use it in GitHub Desktop.
Custom Collections Image Renderer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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