If you’re still looking for an answer... here’s a different method I recently used for a related pages sort of thing.
- Make a TV with input type Multi Select box
- Input option values something like this:
@SELECT pagetitle,id FROM `revo_site_content` WHERE parent BETWEEN '8' AND '33'
where revo_site_content is the full table name for the site_content table, and the WHERE clause is adapted to the parents your related posts can be in (eg your articles parent).
- Output type delimited list, delimited by a comma in my case.
What this will do is create a multi select box with the page titles matching your select query, and, when you output the template variable, show a comma delimited list of selected id’s.
Using this you can then transform them back into a pagetitle with link using a custom output filter (= a snippet).
This is the snippet I used to grab the pagetitle, and add in a lil’ link:
<?php
if ($input == null) {
return 'Geen relevante artikelen gevonden.';
}
$lpr_ids = explode (',', $input);
foreach ($lpr_ids as $a => $key) {
$document = $modx->getObject('modResource', array(
'published' => 1,
'id' => $key));
$title = $document->get('pagetitle');
$output[] = '<a href="'.$modx->makeUrl($key, '',array('i' => 'lex-rel-'.$modx->resource->get(id))).'" title="'.$related.' (Related)">'.$title.'</a>';
}
return implode(', ',$output);
Hope this helps somebody.