Quote from: modxlearner123 at Aug 12, 2010, 01:57 PM
Susan, you had me thinking, I had gone about this all wrong, I tried it on a single page and worked:
<?php
$current_docid = $modx->resource->get('id');
$output ='';
if($current_docid ==4){
$output .='[[$randomimagephotos3]]';
}
return $output;
?>
I simply created a snippet, inserted it into the template as you said, no tvs or anything, I think I had tried this before... 
as always Susan you are the best!
Depending on the caching scheme, you might want to change it to:
$output .=’[[!$randomimagephotos3]]’;
if you run into problems with it constantly showing the same ouput.
BTW, If there’s only one snippet, that’s good. But if there are several and you’re using the number to identify which one is called, you could also use a single snippet and send a parameter (or several parameters) to it with something like this:
$output .= $modx->runSnippet($randomimagephotos, array($num=>'3'));
The variable $num would be available (and set to 3) in the randomimagephotos snippet.
And, yes, Susan is the best.