This file contains hidden or 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
<?php | |
/* | |
* SaveProcessedContent | |
* @author @theboxer | |
* @comments @sepiariver | |
* | |
* GPL, no warranties, etc. | |
* | |
* USAGE: | |
* Enable 'OnDocFormSave' event in Plugin properties, and supply a valid "tvName" value. |
This file contains hidden or 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
<?php | |
/* | |
* @author @sepiariver | |
* | |
* GPL license, no warranties, no liability, etc. | |
* | |
* USAGE EXAMPLE: | |
* [[rootResource? &toPlaceholder=`root_resource`]] | |
* //followed by something like |
This file contains hidden or 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
<?php | |
/* | |
* @author @sepiariver | |
* | |
* GPL, no warranties, no liability, etc. | |
* | |
* USAGE EXAMPLE: | |
* [[!FormIt? &hooks=`iContactPost`]] | |
* | |
* NOTE: using iContact's API would be a more robust approach |
This file contains hidden or 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
<?php | |
/* | |
* MODX Plugin to sandbox Users by User Group, to a specific Resource container. | |
* | |
* @author @sepiariver | |
* GPL, no warranties, no liability, etc. | |
* | |
* Create a Plugin with the code from this gist. Enable the 'OnDocFormPrerender' event | |
* in the 'System Events' tab of the Plugin. Create a namespace, e.g. 'sandbox', and | |
* the following system settings with that namespace: 'sandbox.allow_create', |
This file contains hidden or 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
<!-- Open Graph Tags --> | |
<meta property="og:site_name" content="[[++site_name]]" /> | |
<meta property="og:type" content="article" /> | |
<meta property="og:title" content="[[*longtitle:default=`[[*pagetitle]]`]]" /> | |
<meta property="og:description" content="[[*description:default=`[[++site_description]]`]]" /> | |
<meta property="og:url" content="[[~[[*id]]? &scheme=`full`]]" /> | |
<meta property="og:image" content="[[*image:default=`[[++site_image]]`]]" /> | |
<meta property="fb:app_id" content="[[++fb_app_id]]" /> | |
<meta property="article:publisher" content="[[++fb_url]]" /> | |
<!-- Twitter Tags --> |
This file contains hidden or 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
<!DOCTYPE html> | |
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html class="no-js" itemscope itemtype="http://schema.org/{put something here}"> <!--<![endif]--> | |
<head> | |
<meta charset="[[++modx_charset]]"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title>[[*pagetitle]] | [[++site_name]]</title> | |
<meta itemprop="name" content="[[++site_name]]"> |
This file contains hidden or 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
<?php | |
$eventName = $modx->event->name; | |
switch($eventName) { | |
case 'OnDocFormPrerender': | |
if (!is_object($resource)) { // prevents bad error when user doesn't have perms to resource | |
$modx->log(modX::LOG_LEVEL_ERROR, '[ContentBlocks Templates] No Resource Object on line: ' . __LINE__); | |
return; | |
} | |
// a system setting must be created with the key 'contentblocks.enabled_template_ids' | |
$enabledTemplates = array_map('trim', explode(',', $modx->getOption('contentblocks.enabled_template_ids'))); |
This file contains hidden or 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
<?php | |
/* | |
* fontAwesomeInputOptions | |
* MODX Snippet | |
* @author YJ Tso @sepiariver | |
* GPL, no warranties, etc. | |
* | |
* Usage: execute in TV input options, preferably with @CHUNK binding | |
* alternatively install as Content Blocks input (link to repo coming soon) | |
*/ |
This file contains hidden or 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
<?php | |
// Options | |
$limit = (int) $modx->getOption('limit', $scriptProperties, 3, true); | |
// $limit must be > 0 | |
$limit = ($limit === 0) ? 1 : abs($limit); | |
$tpl = $modx->getOption('tpl', $scriptProperties, ''); | |
if (empty($tpl)) return; // if empty what's the point? | |
$outputSeparator = $modx->getOption('outputSeparator', $scriptProperties, ''); | |
$delim = $modx->getOption('delimiter', $scriptProperties, ',', true); |
This file contains hidden or 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
<?php | |
// Options | |
$input = $modx->getOption('input', $scriptProperties, ''); | |
if (empty($input)) return; | |
$size = $modx->getOption('size', $scriptProperties, 'original'); | |
$toPlaceholder = $modx->getOption('toPlaceholder', $scriptProperties, ''); | |
// Get stuff | |
$image = $modx->fromJSON($input); | |
if (!is_array($image)) return; |