Skip to content

Instantly share code, notes, and snippets.

@jenswittmann
jenswittmann / collections.imageplus.js
Created July 31, 2018 12:52
Custom MODX Collections renderer for Image+ with cropping
collections.renderer.imageplus = function(value, metaData, record, rowIndex, colIndex, store) {
if (value != '' && value != null) {
var data = Ext.decode(value);
var url = MODx.config.connectors_url + 'system/phpthumb.php?imageplus=1';
var params = {};
params.src = 'upload/'+MODx.config['collections.renderer_image_path'] + data.sourceImg.src;
params.w = 100;
if (data.sourceImg.src.indexOf('.png') !== -1) {
params.f = 'png';
@pepebe
pepebe / contextKey.snippet.php
Last active October 14, 2018 19:04
Retrieve Context Key inside snippets. See https://forums.modx.com/thread/30357/solved-return-the-current-context-key for more details.
<?php
/*
* Usage [[!contextKey]]
* */
return $modx->context->key;
@vidhav
vidhav / collections.imageplus.js
Last active April 12, 2024 11:43
Custom MODX Collections renderer for Image+
Collections.renderer.imageplus = function(value, metaData, record, rowIndex, colIndex, store) {
if (value != '' && value != null) {
var data = Ext.decode(value);
var url = MODx.config.connectors_url + 'system/phpthumb.php?imageplus=1';
var params = {};
params.src = MODx.config['collections.renderer_image_path'] + data.sourceImg.src;
params.w = 100;
if (data.sourceImg.src.indexOf('.png') !== -1) {
params.f = 'png';
@em-piguet
em-piguet / README.md
Last active February 2, 2019 13:02
Minimal Portfolio with MODX and Isotope.js