Hello
is you custom field type
able to display a filter ?
i mean does your custom code in your plugin implement the method:
onDisplayFiltered() // this is for category view
onDisplayFilteredSearch() // this is for search view
but the above is optional if you will never display the filter, but this is required:
getFiltered() // this is for category view
getFilteredSearch() // this is for search view
these 2 methods , normally look at our flexicontent values table
but you can make them look at your table and return the FLEXIcontent item IDs that are a match
- just you need to decide what is the value of the filter ? is it a number ?
some text what ?
the you can enter this value in the parameter "Locked filter values" and then your methods
getFiltered() // this is for category view
getFilteredSearch() // this is for search view
will return the matching item IDs
Code:
// Method to get the active filter result (an array of item ids matching field filter, or subquery returning item ids)
// This is for content lists e.g. category view, and not for search view
function getFiltered(&$filter, $value, $return_sql=true)
{
// do some work
$item_ids = array();
//
if (!is_numeric($value))
$ids[] = 51;
elseif ($value < 0 )
{
$ids[] = 4;
$ids[] = 5;
}
elseif ($value == 0 )
$ids[] = 7;
else
$ids[] = 11;
if ($value == 'test')
$ids[] = 113;
else // Do some sql query and add more
// Make sure we only have integer
JArrayHelper::toInteger($ids);
return $return_sql ? ' AND i.id IN (' . implode(',' , $ids) . ') ' : $ids;
}