multiple filters for simple module

edited November 2015 in Bug Reports
Hi!
please advice me how to add several filter to a simple module, eg:
I need to filter news by language and publications
'filters' => array( 'language_equal' => array( 'default' => 'uk', 'label' => 'Lang:', 'type' => 'select', 'options' => array( 'uk' => 'Uk', 'ru' => 'Ru', 'de' => 'De', '' => 'All' ), ), 'published_equal' => array( 'default' => 'yes', 'label' => 'Published', 'type' => 'select', 'options' => array( 'yes' => 'Yes', 'no' => 'No' ), ), )
If I do so, the news filtered only by language, even if option 'just published' is included
I get the message - Filters: Lang:="Uk", Published="Yes"
but in the list view there are not published records...

If I select option 'language_equal' - 'All' and 'published_equal' -'no',
then I can see unpublished news in all languages,
but if language option changed, 'published_equal' filter breaks...

Comments

  • edited 6:51PM
    Be default, the model will use an "OR" clause for the query. To change that, add the following property to your model:
    public $filter_join = "and";
  • edited 6:51PM
    It worked!!!
    cool, tnx!
Sign In or Register to comment.