[[!flickrousel &setname=`home`]]
//find set ID from user-supplied name
foreach((array)$sets["photoset"] as $set){
if($set["title"] == $setname){
$setid = $set["id"];
break;
}
}
This question has been answered by dwillis210. See the first response.
$setname = $modx->getOption('setname',$scriptProperties,'');Passing Values Into a Snippet
Values are passed to your Snippet using a modifed CGI web-form type notation that follows the Snippet's name. If your Snippet were named "mySnippet", you might call it using something like this:
1
[[!mySnippet? &input=`Hello World`]]
And the code for your Snippet might look something like this:
1
2
3
<?php
return 'My input was: ' . $input;
?>
Notice that the variable names in the calling bit need to match the variable names in the Snippet EXACTLY (case matters... i.e. 'input' not 'INPUT' or 'Input'). Secondly, don't forget the '&' in front of the would-be variable names. And last but most certainly not least, take note that those are backticks, not single quotes!
[[flickrousel? &setname=`home`]]
$setname = $modx->getOption('setname',$scriptProperties,'');
return $setname;