i'm trying to filter articles by custom fields. In Wordpress it's quite easy to do, but i'm blocked now.

Here's what i would imagine right to do, but it's not:

JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_content/models', 'ContentModel');

// Get an instance of the generic articles model
$model = JModel::getInstance('Articles');

// Set application parameters in model
$app       = JFactory::getApplication();
$appParams = $app->getParams();

$model->setState('params', $appParams);

// Tri
$model->setState('filter.category_id', $catid);

// Isn't it possible??
$model->setState('filter.jcfields.test', "TEST");

// Retrives items
$items = $model->getItems();


Any ideas?

Thanks a lot.


May be this solution will answer to your question: JL Content Fields Filter.

  • 1
    Interesting extension thanks for sharing. Just for the sake of completeness consider to add more details in your answer about how this extension may help the OP - otherwise this answer should be converted to a comment.
    – FFrewin
    Jan 24 '18 at 12:43
  • Interresting, but does not Joomla offers a way to do it without installing a tierce plugin or module?
    – LiliwoL
    Jan 24 '18 at 15:12

Joomla! doesn't provide this function and it's quite a shame. There is no filter, nor ordering by default. The only way to do that correctly is to use http://easylayouts.net/ extention. It provides ordering and filtering on menu items AND a great com_content override system. There is some place for improvment, but still it solves a lot of things.


I could imagine it to be done by creating a search plugin that reads out the desired custom fields and their values and performs a filter query instead of a search on the listed content. This is just a thought though, I haven't checked the search plugin code to be sure.

  • Welcome to JSE and thank you for contributing. Please take our tour.
    – mickmackusa
    Apr 14 '20 at 10:53

Update: If you are looking for a content filtering solution for Joomla 4, you can try JFilters

Among others, it provides filters from Custom Fields, Categories and Tags. Can be combined with the Joomla's Smart Search and is SEO friendly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.