@EVAL return $modx->runSnippet('getResources',array('parent' => 18));
[[relatedPages? &input=`[[*relatedPages]]` &tpl=`relatedPagesTpl`]]
@EVAL return $modx->runSnippet('getResources',array('parent:IN' => array(18,15,13)));
if (empty($input)) { return 'This article is so unique, that we couldn\'t find anything related to it!'; } $tpl = $modx->getOption('tpl',$scriptProperties,'relatedPagesTpl'); if ($modx->getChunk($tpl) == '') { return 'We found some related pages, but don\'t know how to present it.'; } $ids = explode(',', $input); $output = array(); foreach ($ids as $key => $value) { $resource = $modx->getObject('modResource',array( 'published' => 1, 'id' => $value)); if ($resource instanceof modResource) { $ta = $resource->toArray(); $ta = array_merge($ta,$resource->getTemplateVars()); $output[] = $modx->getChunk($tpl,$ta); } } return implode('',$output);
[[relatedPages? &input=`[[*relatedPages]]` &tpl=`panelTpl`]]
if (empty($input)) { return 'This article is so unique, that we couldn\'t find anything related to it!'; } $tpl = $modx->getOption('tpl',$scriptProperties,'relatedPagesTpl'); if ($modx->getChunk($tpl) == '') { return 'We found some related pages, but don\'t know how to present it.'; } $ids = explode(',', $input); $output = array(); foreach ($ids as $key => $value) { $resource = $modx->getObject('modResource',array( 'published' => 1, 'id' => $value)); if ($resource instanceof modResource) { $ta = $resource->toArray(); $tvs = $resource->getTemplateVars(); foreach ($tvs as $tv) { $ta[$tv->get('name')] = $tv->get('value'); } $output[] = $modx->getChunk($tpl,$ta); } } return implode('',$output);
<div class="wslpanel"> <div class="wslpaneltitle"><h3>[[+TV Panel Title]]</h3></div> <div class="wslpanelimage" style="background-image:url(assets/templates/wos/panels/[[+TV Panel Image]]); background-repeat:no-repeat; background-position:top left;)"><img src="assets/templates/wos/images/frame.png" height="176" width="280" alt="[[+longtitle]]" border="0" /></div> <div class="wslpaneldesc">[[+TV Panel Description]]</div> </div>