How can I expand all search filters by default on the Empire theme?

How can I expand all search filters by default on the Empire theme?

Kuhns
Tourist
5 0 1

I'm looking to have all of the search filters automatically expanded by default instead of just the first one. Currently using the Empire theme. I've found a few suggestions online but none have worked so far. Any input would be appreciated!

 

Screenshot 2023-05-31 150627.png

Replies 13 (13)

NomtechSolution
Astronaut
1245 113 153

It needs code change for collection file and make all filters to display block in css. Then it can show only

Kuhns
Tourist
5 0 1

Yes but i'm stuck as to the code changes needed, that is why i'm reaching out for help. All of the suggestions i've found online weren't helpful.

EdLazor
Excursionist
21 0 7

Did you find a solution to this? I'm trying something similar. I would like to control which filter is expanded by default.

Kuhns
Tourist
5 0 1
I didn't. We ended up switching themes for another reason so it worked itself out because the new theme was already set up to expand all filters.
EdLazor
Excursionist
21 0 7

Did you go with the Empire theme? I found that it offers to have all of the filters expanded by default. Unfortunately, it's an expensive theme.

Kuhns
Tourist
5 0 1
Originally planned on the Empire theme but it seemed to be slower than we liked, ended up going with the Enterprise theme and have been very impressed so far.
EdLazor
Excursionist
21 0 7

Interesting - I already bought Empire, but I'll check out Enterprise for future consideration. I've submitted several support requests to the creator of Empire and have yet to receive an answer in almost a week now....

Kuhns
Tourist
5 0 1
That’s tough. For what it’s worth I’ve asked all kinds of questions to Enterprise’s support and they have been great.

joseph123123
Tourist
3 0 2

Hello, 

I know this is a bit late but in case someone falls upon this, I was able to achieve this through code on Dawn theme.

 

The trick is to add "open" in the "Details" element. 
By default the first filter is set to open but the rest of the filters are collapsed. You can find the code in the file "snippets/facets.liquid".

The line to edit is line 371, and you need to change the code from  forloop.index == 1 to whatever your need is.

joseph123123_0-1710243942864.png

 

I'm currently using Dawn with the Search & Discovery app.

 

Hope this helps.

 

TVmaker
Visitor
2 0 2

Thanks for this! I'm also Dawn and Search & Discovery App.

 

Have you had any issues with filters where "open" doesn't default them to expanded. I removed forloop.index == 1, so that when vertical all filters should default expanded. I verified in the output html code that open is present for both of my filters, "Price" and "Section" (metafield), but only the Price filter is expanded on page load.  Any ideas?

TVmaker
Visitor
2 0 2

Never mind. There's an additional section that needs to be updated for boolean or List type filters. It's the same change as indicated above by Joseph123123, but it's on line 136. 

sophialili4
Visitor
1 0 0

i also want to add this feature in my shopify store. can you guide me regarding this? I don't want to use any app or plugin due to site load speed

AutoPartsAAA
Tourist
7 1 0
  1. Open the theme editor (Customize)
  2. Use the page selector to select Collections, then Default collection
  3. In the left sidebar, click to open Filters (below Collection pages)
  4. Filter visibility, select Expand all groups

 

AutoPartsAAA_0-1717713885054.png