Tell us what you are trying to do?
Hi there. We need to revisit this ticket: https://toolset.com/forums/topic/help-with-search-modifications/
The solution isn't actually working. Actually it makes no difference whether the code is in place or if I comment it out.
The site is efao.ca, specific page is hidden link (its a document library)
If you open up the research section you will see there are various filters.
Currently if you select, for example: Year 2019 you will get results, and Year 2018 you will get results, but if you select years 2018 and 2019 you will get no results. Its looking for documents with both of those tags (AND). What we need is for either of those tags (OR).
In the previous ticket we were provided with the solution from here: https://toolset.com/errata/not-possible-to-compare-multiple-custom-field-filters-with-or-instead-of-and/
Either we though it was working and it wasn't, or it has stopped working. As mentioned, it doesn't make a difference to the results whether we have the code in place or not.
Thank you
actually I just realized what the code is doing.
If you look at my attached screenshot you'll see our Search section has 4 Custom fields (Language, Year, Document Type, Research Category).
The default behaviour is for example, you have something selected under Year, and something selected under Document Type, you will only get results that match both of those criteria. (In my example, documents have to 2018 AND Research Summary)
The custom code changes that to an OR, so in my example I get document that have 2018 OR are Research Summary Documents.
In this particular case, the default is actually ok.(AND)
What we are looking for is if there are multiple options selected in a custom field for those to be OR.
So for example If I have 2018 and 2019 selected under Year, and Research Summary under documents, we would like the results to contain : documents properties (2018 or 2019) AND Research Summary.
Basically OR within the different properties of a custom field.
How can we achieve this?
Thank you
Hello,
The credentials you provided in previous thread is removed:
https://toolset.com/forums/topic/help-with-search-modifications/#post-2352551
since it is a custom codes issue, please provide your website credentials in below private message box, I need to test and debug it in a live website, thanks
Thanks for the details, I have done below modifications in your website:
Edit the post view "Research Library List":
hidden link
In section "Query Filter", change the "Year" field filter from:
Year is a string equal to URL_PARAM(wpv-wpcf-year)
To:
Year is a string in URL_PARAM(wpv-wpcf-year)
Please test again, check if it is fixed.
More help:
https://toolset.com/documentation/user-guides/views/filtering-views-by-custom-fields/
IN
A list of values Checks if the custom field value is within the list of compare values
My issue is resolved now. Thank you!