0

I am using sxa check list filter. For multiple category filter the filter button is coming automatically can anyone pls help to enable the multiple filter without button.. It seems that I need to change in searchfilter. Js but not able to do. Thanks

  • Can you hide the button with css? – Michael West Oct 21 at 15:04
  • I can hide but multi filter will not work – Barada behura Oct 21 at 15:17
0

You will have to modify component-search-results-filter.js file.

There is if (properties.multi) inside updateFacet function.

If you will look inside there is another if

if (currentFacet[0].type == "button") {
    for (i = 0; i < sig.length; i++) {
        // updating hash here
    }
    queryModel.updateHash(hash); // this is what should be called to cause results to reload
}

You can remove this if condition and it will work (leave the logic specified inside in place). What you want is to invoke this logic for ever case, not just Filter button.

In a normal scenario when you click on a Filter button this condition in the if returns true. In your case, when you click on a facet name it is just a <p> element

| improve this answer | |
  • Could you please help me to apply to specific page instead of affecting whole site by extending this?we have multiple languages sites so of I will change the Base theme it will affect other sites as well – Barada behura Oct 23 at 7:16
  • First option: Make a copy of the Search Theme, modify scripts, assign the custom Search theme to your site theme/ page (whole site or just page using a theme to page design mapping, and then assign design explicitly to your page) The other option I can see (to apply to a single page) is to create a custom MetaPartial rendering where you will overwrite the function in your custom JSS injected into the page. Third option. Add a script to your theme to overwrite the behavior in search rendering but do it only when a particular body class is present (body class can be set on any page) – Alan Płócieniak Oct 23 at 7:26

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.