I have created a custom field in the admin menu lets call it students
, id like to filter articles in my module based of this custom field , below is what i have done so far in my module :
can get form post values in my mod_****.php
:
if (isset($_POST))
{
$post = $app->input->post->get('basicSearch', array(), 'array');
$returnpost = ModSearchFormEducare::processform($post);
}
I can filter the articles based on category using Jlegacy
api , helper.php
public static function processform($post)
{
$post['study'] = 14; //some temporary cat_id
$model = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => false));
$app = JFactory::getApplication();
$appParams = $app->getParams();
$model->setState('params', $appParams);
// Category filter
$model->setState('filter.category_id',$post['study'] );
// $returnpost = $model->getItems();
return $returnpost ;
}
What I'd like to achieve is set a filter based on custom fields in created in admin, this I have seen are stored in attribs
column in __content
table. Any help is appreciated.