Ok. I’m trying my hand at creating my own extender. Something isn’t working however.
Ditto call
[!Ditto? &parents=`47,48,49,50,51,52` &sortBy=`pagetitle` &sortDir=`ASC` &display=`all` &extenders=`lodging` &tpl=`mem_content_tpl` &tplAlt=`mem_content_tplAlt` !]
Extenderfile lodging.extender.inc.php
<?php
// lodging.extender.inc.php
$filters["custom"]["lodging"] = array("mem_category","lodgingFilter");
if (!function_exists("lodgingFilter")) {
function lodgingFilter($resource) {
if (strpos($resource['mem_category'], 'motels') || strpos($resource['mem_category'], 'bed & breakfast')) {
return 1;
} else {
return 0;
}
}
}
?>
What I want is for the filter to return the result if the string ’motels’ or ’bed & breakfast’ is in the template variable (text type) mem_category. But it isn’t working. Can someone spot my mistake(s) and help me out?
Thanks!