Created
November 30, 2018 00:54
-
-
Save dubrod/c93d7599ebee27a99247b908324d9783 to your computer and use it in GitHub Desktop.
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
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-- | |
$q = $modx->newQuery('modResource'); | |
$q->where(array('published'=>'1','hidemenu'=>'0','isfolder'=>'1','parent'=>'16','class_key'=>'modDocument')); | |
$q->sortby('menuindex','ASC'); | |
$resources = $modx->getCollection('modResource',$q); | |
OR--- | |
$modx->getObject('modResource', 555); | |
WITH DEPTH---- | |
$parent = 20; | |
$depth = 3; | |
$childs = $modx->getChildIds($parent,$depth); | |
$c = $modx->newQuery('modResource'); | |
$c->where(array('published'=>1)); | |
$c->where(array('id:IN'=>$childs)); | |
$c->sortby('id','DESC'); | |
$c->limit(3); | |
$children = $modx->getCollection('modResource',$c); | |
---- | |
$id = $modx->getOption('id', $scriptProperties); | |
$modx->log(modX::LOG_LEVEL_ERROR,'getLatLong was run: ' . $data); | |
//set placeholder | |
$modx->setPlaceholders(array( | |
'name' => 'John', | |
'email' => '[email protected]', | |
),'my.'); | |
//make url | |
$url = $modx->makeUrl(4); | |
$siteStartId = $modx->getOption('site_start'); | |
$key = "Topgolf Orlando"; | |
$ctx = $modx->getContext($key); | |
if ($ctx) { | |
return $ctx->getOption('upcoming_hours_placeholder', null, 'default'); | |
} else { | |
/* context doesn't exist */ | |
} | |
//MIGX value in a snippet | |
$sec_answers = $modx->fromJSON($sec->getTVValue('quizy_answers')); | |
foreach($sec_answers as $ans) { | |
$ans_output .= $modx->getChunk('quizy-answer-row',array('text' => $ans["answer"])); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment