The breadcrumbs show the item name and not the collection it's in

Hey everyone!

I have 2 questions on how to fix my breadcrumbs.

  1. My breadcrumbs shows the product name and not the collection it’s in (Please see below)

  1. Also, If you view the product off the landing page it doesn’t show the collections it’s in. But if I go through my tabs “For Her, Selfcare, then the product” it will show the collection (plus the product name)

Please see the difference between the top screenshot and the below one, both the same product, both have different breadcrumbs.

Theme: Dawn

Website: https://meeko-8476.myshopify.com

Password: Meeko

This is the anchor attribute in: card-product.liquid

href=“{{ card_product.url | within: collection }}”

This is the code for breadcrumb.liquid :

.breadcrumbs { margin: 0 0 2em; } .breadcrumbs__list { list-style-type: none; margin: 0; padding: 0; } .breadcrumbs__item { display: inline-block; } .breadcrumbs__item:not(:last-child):after { border-style: solid; border-width: .10em .10em 0 0; content: ''; display: inline-block; height: .20em; margin: 0 .20em; position: relative; transform: rotate(45deg); vertical-align: middle; width: .20em; } .pd_20 { padding-top: 15px; } .breadcrumbs__link { text-decoration: underline; } .breadcrumbs__link[aria-current="page"] { color: inherit; font-weight: normal; text-decoration: none; } .breadcrumbs__link[aria-current="page"]:hover, .breadcrumbs__link[aria-current="page"]:focus { text-decoration: underline; } .breadcrumbs__link_1 { padding-left: 10px; } .breadcrumbs__item.breadcrumbs__link_n a { padding-left: 10px; }

{%- unless template == ‘index’ or template == ‘cart’ or template == ‘list-collections’ or template == ‘404’ -%}
{%- assign t = template | split: ‘.’ | first -%}

  1. Home
  2. {%- case t -%} {%- when 'page' -%}
  3. {{ page.title }}
  4. {%- when 'product' -%} {%- if collection.url -%}
  5. {{ collection.title | link_to: collection.url }}
  6. {%- endif -%}
  7. {{ product.title }}
  8. {%- when 'collection' and collection.handle -%} {%- if current_tags -%}
  9. {{ collection.title | link_to: collection.url }}
  10. {%- capture tag_url -%}{{ collection.url }}/{{ current_tags | join: "+"}}{%- endcapture -%} {{ current_tags | join: " + "}}
  11. {%- else -%}
  12. {{ collection.title }}
  13. {%- endif -%} {%- when 'blog' -%} {%- if current_tags -%}
  14. {{ blog.title | link_to: blog.url }}
  15. {%- capture tag_url -%}{{blog.url}}/tagged/{{ current_tags | join: "+" }}{%- endcapture -%} {{ current_tags | join: " + " }}
  16. {%- else -%}
  17. {{ blog.title }}
  18. {%- endif -%} {%- when 'article' -%}
  19. {{ blog.title | link_to: blog.url }}
  20. {{ article.title }}
  21. {%- else -%}
  22. {{ page_title }}
  23. {%- endcase -%}
{%- endunless -%}

Hi @meeko

May I suggest to update code below:


{%- unless template == 'index' or template == 'cart' or template == 'list-collections' or template == '404' -%}
{%- assign t = template | split: '.' | first -%}

{%- endunless -%}

Hi @EBOOST

Thank you so much for your reply.

I added the above code, it’s now showing this funny banner on the homepage

And unfortunately it’s still showing the name of the product in the breadcrumbs (Below)

Do you know if there is a fix for these?

Kind regards,

Adrian

Hi @meeko

  1. It is not related to code above. I saw it’s a richtext

  1. You can use code below to remove product name

{%- unless template == 'index' or template == 'cart' or template == 'list-collections' or template == '404' -%}
{%- assign t = template | split: '.' | first -%}

{%- endunless -%}
1 Like

Hi @EBOOST

Yay that worked!!

Sorry how to I remove those 2 banners that are on the home page? :slightly_smiling_face:

Hi @meeko

I suggest these steps

  1. Go to Store Online-> theme

  2. Customize

EBOOST_0-1674562850466.png

  1. Click eye icon to turn on/ turn off section