Breadcrumbs Taste Theme - Add Collection

Hey guys, just added breadcrumbs to my website (www.cringe.bg), using this guide: https://community.shopify.com/topic/1238983

everything works well, but the “Collections” link don’t seem to visualise and I cannot understand why.

Here is a screenshot from this page. Basically it says “Home page > Name of product”.

I would like it to be “Home page > Collection page > Product page”.

Thank you!

Hello @cringebg ,

Then your URL should be like this
https://cringe.bg/collections/teniski/products/teniska-neposlushen-spisuk

And to do this you need to replace
{{ product.url }} with {{ product.url | within: collection }}

Thanks

Thank you, but how do I replicate this url natively when I open a product from any collection on our website? I suppose this is quite hard to do in the theme, right?

Correct me if I am wrong, I am not so experienced in coding: Maybe a simpler way to do this would be to display a default collection in which the product is (except the collection “all products”, in which all products automatically fall into). Most products only have 2 collections so this should be good enough. Thank you :slightly_smiling_face:

Go to your Online store > Themes > Edit code > open card-product.liquid file, find those lines of code

href="{{ card_product.url }}"

Replace with this to add collection in URL of product then it will appear Collection title in your breadcrumbs

href="{{ card_product.url | within:collection }}"

Wow thanks! Worked great. Merry Christmas :slightly_smiling_face:

Welcome, and the same to you!

One more quick question if you have the time: How would I make the linked breadcrumbs black in color? I suppose its in the base.css, I tried adding a “color: black !important;” code but it didnt work, probably I am doing something wrong. Thank you!

Please use this code.

.breadcrumbs a {
color: #000;
}

Dan you are the MVP!

I’m happy I could help.