limit the breadcrumbs to main collections from navigation bar

konradkonrad
New Member
1 0 0

Hello everyone,

I had a problem with breadcrumbs because those weren't directed to collections.
I've managed using for loop etc with limit to 1 - because many of the products are in more than one collection -and all of those collections were visible in breadcrumbs. (that was wrong)
this is the code: (and that code shows one collection - which is good)

 

 

    {% for collection in product.collections limit:1%} 
    {% if collection.title != "Home page" %} 
      <span aria-hidden="true" class="separator"><i class="la la-angle-right" aria-hidden="true"></i></span>
      <a href="{{ collection.url  }}" title="{{ collection.title }}">  {{ collection.title  }}</a>
     {% endif %} 
     {% endfor %} 

 

 

 

Because for loop is limited to 1 collection, how can I set up the breadcrumb collection that is on the main collection from navigation bar?
For example here: product is shows collection: BEDROOM CEILING LIGHTS, but it should be collection: PENDANTS, and direct back to pendants 

All 7 main collections are below LIGHTING category on navigation bar.

I think I need an if statement, which will squeeze down all the  product collections to only 7, and then display one - the right one.

e.g: this products works perfect: floor lamp or chandelier 

0 Likes
alvinkonda
Shopify Partner
44 5 9

Hi,

Shopify has no collection hierarchy, which means that all collections are treated equally in Shopify, so I guess you can not set your main collection to be displayed on the breadcrumbs. 

Anyway, I'm no seeing breadcrumbs being used that often anymore. As soon as your navigation system is properly organized, I think your store's usability should be fine without using breadcrumbs. 

FireTheme.com - The Best Free Shopify Theme To Increase Conversion Rates (CVR)
Increase your store conversion rates (CVR) and average order value (AOV) with FireTheme, the world's most-loved Free Shopify Theme. Developed for maximum performance, flexibility in mind, and simplicity at core, you can be 100% sure that...
0 Likes