1

Hello everyone (Merry Christmas), I’m just using EE to create a small website. I can not understand how I can make filters for custom channel fields.

I have a channel “Properties” with fields {id_immobile} type Number, {common} type String, {contract} type String and {type} type String. All have the Include check mark in the search.

I created a Form inspired by that in the documentation but I do not think is correct.

{exp:search:advanced_form channel="immobili" result_page="immobili/search"}
 <!--<input type="hidden" name="search_in" value="entries"/>-->
    <input type="hidden" name="where" value="word"/>
 <div class="form-group">
     <select class="form-control" name="keywords">
   <option selected disabled>Seleziona Contratto</option>
            <option value="Vendita">Vendita</option>
      <option value="Affitto">Affitto</option>          
     </select>
   </div>
 <div class="form-group">
     <select class="form-control" name="">
   <option selected disabled>Seleziona un Comune</option>
            {exp:channel:entries channel="comuni"}
      <option value="{title}">{title}</option>
   {/exp:channel:entries}            
     </select>
   </div>
        <div class='searchSubmit'>
                <input type='submit' value='Search' class='submit' />
        </div>

{/exp:search:advanced_form}

I would like the research to work based on choices. Example: only for a field if selected, or for more fields.

Thanks in advance

1

The standard search features of EE do not support much refinement of the search itself beyond specifying which channel to search within.

If what you want to do is adjust what gets displayed once the search is complete, the only way to do this is to focus on the processing of the search results rather than the search request. So run the search using whatever terms / scope you can, and then when it comes to displaying the output only output entries that match your filtering criteria.

The output of search is handled using the search:search_results tag. You need to pass the select options chosen to the search results page, and filter on these there.

HTH

| improve this answer | |
  • Thanks for your quick reply but it was not the right problem. I have inserted a new description above.Thanks for your help. – Alessandro Dec 26 '18 at 11:25
  • Have updated answer to be relevant to your new question. – JCOGS Design Dec 26 '18 at 15:50
0

The options are generated perfectly and work. My problem is to filter for the various Select. The select are Custom Fields of my own channel called Real Estate.

I want to create a search filter for the first Select OR second Select OR third Select.

Example: I select only Contract-> Sale of the first Select, it must find all the Properties that have the custom field named {Contract}. Selecting Sale of the first select and an option of the second Select (Exp. Municipality-> Italy), must find all the Properties that have the custom field named {Contract} and custom field named {Municipality}

I hope I have made my problem better understand this way.

Thanks for your help

| improve this answer | |

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.