Hi Shawn,
Cat is short for category, I want to return all data from a custom table which is in a particular category.
The getUrlParam snippet doesn't have the option to set to placeholder. I'm assuming I need to add something to this snippet so that it would output to a placeholder. Would it simply be a case of adding:
$modx->toPlaceholder('category');
Here is the full snippet without any changes.
// set defaults
$name = $modx->getOption('name',$scriptProperties,'p');
$int = $modx->getOption('int',$scriptProperties,false);
$max = $modx->getOption('max',$scriptProperties,20);
$output = $modx->getOption('default',$scriptProperties,'');
// get the sanitized value if there is one
if (isset($_GET[$name])) {
if ($int) {
$value = intval($_GET[$name]);
} else {
if (strlen($_GET[$name]) > $max) {
$value = filter_var(substr($_GET[$name],0,$max), FILTER_SANITIZE_STRING);
} else {
$value = filter_var($_GET[$name], FILTER_SANITIZE_STRING);
}
}
$output = $value;
}
return $output;
Thanks