using a custom snippet from the tutorial mentioned above
chunk:
[[relatedPages? &input=`[[*isNewFilm]]` &tpl=`archive-image-tpl`]]
relatedPages snippet:
<?php
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) {
$fields = $resource->toArray();
$fields['archive-image'] = $resource->getTVValue('archive-image');
$output[] = $modx->getChunk($tpl,$fields);
}
}
return implode('',$output);
tpl archive-image-tpl:
<li class="archive-item">
<a href="[[~[[+id]]]]" rel="galerie">
<img data-href="[[+tv.archive-image]]" alt="[[+pagetitle]]" src="assets/webapps/jail/_img/fa_loading.gif" width="200" height="281" /></a>
<a href="[[~[[+id]]]]"><p><em>[[+pagetitle]]</em> ([[+tv.release-date]])</p></a>
</li>
archive-image and release-date aren't being processed
any help would be greatly appreciated, site has to go live shortly...
[ed. note: pjldesign last edited this post 12 years, 2 months ago.]