Skip to content

Instantly share code, notes, and snippets.

@pepebe
Forked from christianseel/introRTE
Last active July 8, 2016 12:54
Show Gist options
  • Select an option

  • Save pepebe/c12aa4aa10b4804bc6e0 to your computer and use it in GitHub Desktop.

Select an option

Save pepebe/c12aa4aa10b4804bc6e0 to your computer and use it in GitHub Desktop.
<?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>');
<?php
// Add RTE for introtext if richtext option is enabled for the resource
// check "OnDocFormRender" event
$templateIDs = array(26);
if( in_array( $resource->template , $templateIDs ) ) {
$modx->regClientStartupHTMLBlock('<script>Ext.onReady(function() {
if(MODx.loadRTE) MODx.loadRTE("modx-resource-introtext");
});</script>');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment