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
QUERIES | |
$resources = $modx->getCollection('modResource', array('published'=>'1','hidemenu'=>'0','isfolder'=>'1','parent'=>'16','class_key'=>'modDocument')); | |
foreach($resources as $resource) { | |
$id = $resource->get('id'); | |
$thumb = $resource->getTVValue('thumbImage'); | |
} | |
OR-- |
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
https://rtfm.modx.com/revolution/2.x/developing-in-modx/advanced-development/modx-services/modmail | |
/* modx mail service */ | |
$modx->getService('mail', 'mail.modPHPMailer'); | |
$modx->mail->set(modMail::MAIL_BODY,$message); | |
$modx->mail->set(modMail::MAIL_FROM,$from); | |
$modx->mail->set(modMail::MAIL_FROM_NAME,'Quick Quote'); | |
$modx->mail->set(modMail::MAIL_SUBJECT,'Lease Quote #'.$id.''); | |
$modx->mail->address('to','sales@theleaseoutlet.dsmessage.com'); | |
//$modx->mail->address('reply-to','me@xexample.org'); |
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
Friendly URL container_suffix must = / | |
System Setting: | |
Key: archivist.archive_ids | |
name empty | |
namespace: archivist | |
area lexicon: furls | |
value: 18:arc_ (18 being resource id) | |
Archive Template ( needs to be container ) |
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
http://rtfm.modx.com/extras/revo/formit/formit.tutorials-and-examples/formit.handling-selects,-checkboxes-and-radios | |
[[!FormIt? | |
&hooks=`spam,email,redirect` | |
&emailTpl=`ContactEmailTpl` | |
&emailFrom=`[[++emailsender]]` | |
&emailTo=`wayne@modx.com` | |
&emailUseFieldForSubject=`1` | |
&redirectTo=`33` | |
&validate=`name:required, |
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
GetParentAlias | |
$output = ''; | |
/* Get the current resource's 'parent' field */ | |
$parentId = $modx->resource->get('parent'); | |
/* Get the parent object */ | |
$parentObj = $modx->getObject('modResource', $parentId); | |
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
//touch/mobile detection | |
if ( | |
navigator.userAgent.match(/Phone/i) || | |
navigator.userAgent.match(/DROID/i) || | |
navigator.userAgent.match(/Android/i) || | |
navigator.userAgent.match(/webOS/i) || | |
navigator.userAgent.match(/iPhone/i) || | |
navigator.userAgent.match(/iPod/i) || | |
navigator.userAgent.match(/BlackBerry/) || | |
navigator.userAgent.match(/Windows Phone/i) || |
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
// == Script Origin and Discussion | |
// https://forums.modx.com/thread/?thread=80740&page=2 | |
// Used Oct 2016 on MODX 2.5 | |
// == Form Markup | |
[[!UpdateProfile? &validate=`fullname:required,email:required:email` &preHooks=`UploadProfilePhoto`]] | |
<label for="Profile_Photos">Profile Photo <span class="error">[[!+fi.error.Profile_Photos]]</span></label> | |
<img src="[[+Profile_Photos:phpthumbof=`w=210&h=210`]]" /> | |
<input id="Profile_Photos" name="Profile_Photos" type="file" value="[[+fi.Profile_Photos]]" maxlength="100000" /> |
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
//SNIPPET | |
$datearr = []; | |
$users = $modx->getIterator('modUser', array('active'=>'1')); | |
foreach ($users as $user) { | |
$profile = $user->getOne('Profile'); | |
$dob = date("Y", $profile->get('dob')); | |