Filter by Tag in Dawn Theme

Laurie_ONeill
Shopify Partner
71 0 32

I've been playing around with Dawn theme and am so confused because it doesn't seem to have any built in way to sort a collection by tag...the filter on the collection page only has the options of sorting by product type, price, vendor, and availability. Every Shopify theme I've ever worked with has the ability to sort products by tag built into it somewhere and this is a feature I need on every site I am working on as I need to be able to filter by custom categories such as 'Occasion', etc. Do I have to figure out how to code this in myself? Or am I just missing something? Thanks in advance!

Replies 58 (58)
LetsGetDigital
Shopify Partner
20 0 26
Can you expand on that for the rest of us mortals?
jmp
Excursionist
19 2 29

Sure thing, I'll try. A reminder that this worked for me with the Empire theme. Not sure if all 2.0 themes work this way.

Go to Edit Code for your theme. For each Section that you want to be available in a page template, you have to scroll down to the bottom of the section liquid and within the {% schema}, find the "templates" list. It should say "index" (homepage) at the very least. Add "page" to the templates list, like so:

{% schema %}

[...]

 "templates": [
    "index",
    "product",
    "page"
  ]
}

{% endschema %}

Don't forget to put a comma after each template except for the last one.

I hope this helps. Sorry to the others for taking this thread into a tangent.

Laurie_ONeill
Shopify Partner
71 0 32

This is really helpful, thank you! I chose Modular over Empire mainly because it didn't look like Empire was set up to have sections on the pages, and I wasn't able to access the code in the trial version to see, so it's nice to know that it is easily remedied in case I need to use Empire in the future for anything! Thanks!

jmp
Excursionist
19 2 29

No problem!

I know what you mean. I couldn't get sections to work in the trial, but I naively thought it was probably a limitation of the trial since 2.0 boasts that you can add sections anywhere, so we bought the theme anyway. When I still couldn't add sections after buying it, my heart sank and I hoped I hadn't just thrown money into a fire. Luckily I found this little remedy last night and we're back on track! Huge relief.

Now that that is taken care of, I can safely say that this theme is awesome. I really love the group tag filtering, and the fact that you can select multiple tag filters across different categories.

At least we know that product tag filtering is still possible with 2.0 themes, although it depends on the theme and/or your coding expertise. I definitely still get the feeling they will eventually phase them out entirely.

seb87
Shopify Partner
16 0 14

Here is a new update in the github repository about filtering metafileds with api:

https://github.com/Shopify/storefront-api-feedback/discussions/10#discussioncomment-1464732

schwarzinger
Tourist
4 1 1

Thanks for this. I learned that the reason Dawn filtering isn't working is because there's a product limit of 1000.

Which explains why all my collections have filtering, except for my View All collection. 

Ardi94
Pathfinder
101 2 26

This is great news. Filtering by metafield is a great addition. it'll take some time to apply new metafields to all our products but it will definitely be worth doing. There are two things I hope Shopify adds soon, right now filter by metafield is only available for

  • single_line_text_field
  • number_integer
  • number_decimal

But I think these two other types should definitely be available:

  • Rating
  • Boolean

Both can give even more flexibility. If anyone is wondering, my workaround for the missing two is to use normal number_integer (for rating it's just a number and for Boolean: true, it is 1)

bredowmax
Explorer
68 1 91

Yeah these Metafield filters are fantastic news!

Personally, I’ll wait until the Binary one is launched before adopting it - it’s the obvious next step and I’m hoping it won’t be too long.

I know it’s possible simulating a Binary one with single line text “true” or number 1 - but in practice I imagine it will be too complicated to explain to staff what 1 means in which context. and when I switch the current setup, then for a proper solution and not yet another workaround

Jayp_Rajput
New Member
4 0 0

Yes But its default filter without custom tagging