215 Posts
iliil
8 years ago
Topic

Hello I guess I need a help. 

I need to set up my search type in the way so if no option is selected in a select field of my search form  I won't output any search results.

I use multiple select dield for selecting related articles which I display in the search list in article template (using Form & List Pack field). The problem comes when user doesn't select no related articles. It displays all of them (instead of none).....

I'm using SEBLOD for years, but I can not manage that.

Thanks for a possible help

Michal

Get a VIP membership
4229 Posts
Kadministrator
8 years ago
1
Level 1

You could add another field with live value that does not match any result, eg. article_id and put live value like -99 on it. Then add conditional that this field is enabled when your multiselect "is Filled"

215 Posts
iliil
8 years ago
0
Level 2

Hi Klas. Thanks for your answer. I've tried that. Your solution can be used in a standard search list page situation. I'm showing the list in another content type article ( using the list filed ) and as there is no form -> no conditionals can be applied...

Finally I helped myself with the commercial SQL_before_store plugin. In fact I found this plugin soo useful.

My solution was:

  • I have created a new hidden text field (next to the multiple selrct) in the article form
  • I populated this hidden field with the value of the multiple select (coma separated id's) or with -99, if the select field is empty.
  • in the article content view I use this hidden field as a search criteria for the nested list.


SEBLOD IS GREAT!

Get a Book for SEBLOD