Skip to content

Instantly share code, notes, and snippets.

@morelmm
morelmm / babelGen.snippet.php
Created November 17, 2016 18:51
Modx/babel recursive translation generation
<?php
$id =$scriptProperties['id'];
$ctxSource = $scriptProperties['ctxSource'];
$ctxDest = $scriptProperties['ctxDest'];
$count = 0;
global $babel;
$babel = $modx->getService('babel','Babel',$modx->getOption('babel.core_path',null,$modx->getOption('core_path').'components/babel/').'model/babel/');
$resources = $modx->getCollection('modResource',
array('parent'=> 0, 'context_key' => $ctxSource));
@morelmm
morelmm / richintrotext.plugin.php
Created February 23, 2017 19:52
Modx introtext RTE
<?php
// Add RTE for introtext if richtext option is enabled for the resource
// check "OnDocFormRender" event
$modx->regClientStartupHTMLBlock('<script>Ext.onReady(function() {
if(MODx.loadRTE) MODx.loadRTE("modx-resource-introtext");
});</script>');