We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

"==" does not work on field search in Pro Search

Development and Programming

studionigh's avatar
studionigh
17 posts
about 10 months ago
studionigh's avatar studionigh

I have created a website much like the ExpressionEngine Add-On page. (EE 7.5.8, PHP: 7.4.33)I built the site following the article at EE University here: https://u.expressionengine.com/article/advanced-searching-with-low-search-and-ajax. I followed the article that was written using the Low Search but it works great with the Pro Search. I created a Multi-Select field just as they did for “add_on_compatibility”. This field has about 16 different check boxes for “add_on_compatibility” items. The problem in the search filtering, the “==” is treated like “*=” or Contains, on this line of code:

{if pro_search_search:add_on_compatibility =="4"}checked{/if}

So if I click on a checkbox that is 4 or 14, the search results show both (because both include a 4). if I try a Tilda ~ “matches”, it does not work. Here is the code to show a checkbox:

<li>
   <input 
    type="checkbox"
    name="search:add_on_compatibility[]"
    data-action-uncheck="show-all-compatibility"
    id="EE4" 
    value="4" 
    {if pro_search_search:add_on_compatibility =="4"}checked{/if}
    />
    <label for="EE4">EE 4</label>
</li>

What are my options here? If there are more than 9 check boxes in the add_on_compatibility field, it will be a problem.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.