How do I remove the 'Collection list' or All Collections from breadcrumbs path in Dawn Theme 15.0.0?

DAWN THEME 15.0.0

Hi everyone!

I want my breadcrumbs to only show the actual collections the products are in and NOT show a path to ‘all collections’.

I don’t want this: Home > Collections > Collection > Product

Instead, I want this: Home > Collection > Product

Please help thanks!

@Boomdeleon Please share your store url for reference. And also are you using the latest version of dawn theme v15?

Thanks

Yes, I’m using the latest version. My store is not live.

@Boomdeleon as per the example you provided above of home then collection then product i believe you only want te breadcrumb on the product page?

I suppose, but there needs to be a breadcrumb to home from the collection as the homepage displays all of the categories/collections.

Here’s the code I’m using

{%- style -%}
  {% if section.settings.enable_complete_site %}
    .breadcrumbs{
      display: block;
    }
    {% endif %}

  {% if template == 'collection' and section.settings.enable_collection_page  %}
     .breadcrumbs{
       display: block;
     }
   {% endif %}

       :root  {
         --svg_fill: {{ section.settings.breadcrumb_text_color}}
         ;
       }

       .home-icon-container {
         display: inline-block;
         margin-right: 4px;
         vertical-align: sub;
       }

       .breadcrumbs {
         padding: 1rem 5rem;
         color: {{ section.settings.breadcrumb_text_color }}
         ;
         background-color: {{ section.settings.breadcrumb_bg_color }}
       }

       .breadcrumbs li {
         display: inline-block;
       }

       .breadcrumbs a {
         text-decoration: none;
         /*Will put liquid customization here*/
         font-size: 12px;
         color: inherit;
       }

     {%- if section.settings.breadcrumb_accent_color_bool -%}
         .breadcrumbs a:last-of-type {
           color: {{ section.settings.breadcrumb_accent_color }}
            !important;
         }
       {%- endif -%}

       .breadcrumb-delimeter:not(:last-child):after {
         {%- case section.settings.breadcrumb_delimeter -%}
           {%- when "angle_right" -%}
           content: "›";
           font-size: 18px;
           {%- when "slash" -%}
           content: "/";
           font-size: 12px;
           {%- when "arrow_right" -%}
           content: "➤";
           font-size: 15px;
           {%- when "squiggle_arrow" -%}
           content: "\27FF";
           font-size: 25px;
           {%- when "right_long" -%}
           content: "\279E";
           font-size: 18px;
           transform: translateY(5%);
           {%- when "double_right" -%}
           content: "\00BB";
           font-size: 20px;
           {%- when "diamond_arrow_head" -%}
           content: "⤞";
           font-size: 25px;
           transform: translateY(5%);
           {%- when "heavy_angle_right" -%}
           content: "\276F";
           font-size: 18px;
           transform: translateY(5%);
         {%- else -%}

         {%- endcase -%}
         display: inline-block;
         margin-left: 0.75rem;
         margin-right: 0.50rem;
         speak: none;
       }

       .breadcrumbs [aria-current="page"] {
         color: inherit;
         font-weight: normal;
         text-decoration: none;
       }
{%- endstyle -%}

  {%- unless template == 'index' or template == 'cart' -%}
    {%- if section.settings.breadcrumbs_home_icon_bool -%}
      

        
      

    {%- endif -%}

    Home
    {%- case template.name -%}
      {%- when 'article' -%}
        {%- for link in linklists['main-menu'].links -%}
          {%- if link.url == blog.url -%}
            
            
            {{ link.title | link_to: link.url }}
            {% break %}
          {%- endif -%}
        {%- endfor -%}
        
        {{ article.title }}
      {%- when 'product' -%}
        {%- capture product_url_string -%}
        {%- for collection in product.collections -%}
          {{ collection.url }}|
        {%- endfor -%}
      {%- endcapture -%}

        {%- assign object_url_string = product_url_string | append: product.url -%}

        {%- assign object_urls = object_url_string | split: '|' -%}
        {%- capture linklist_titles_str -%}
        {%- for linklist in linklists -%}
          {{ linklist.title | handleize }}|{%- endfor -%}
      {%- endcapture -%}
        {%- assign str_size = linklist_titles_str | size | minus: 1 -%}
        {%- assign linklist_titles_str = linklist_titles_str | slice: 0, str_size -%}
        {%- assign linklist_titles = linklist_titles_str | split: '|' -%}

        {%- assign level = 1 -%}
        {%- for link in linklists['main-menu'].links -%}
          {%- assign link_handle = link.title | handle -%}
          {%- assign link_titles = link_titles | append: link.title | append: '|' -%}
          {%- assign link_urls = link_urls | append: link.url | append: '|' -%}
          {%- assign link_levels = link_levels | append: level | append: '|' -%}
          {%- assign link_parents = link_parents | append: 'main-menu' | append: '|' -%}
          {%- assign link_handles = link_handles | append: link_handle | append: '|' -%}

          {%- if linklist_titles contains link_handle -%}
            {%- for clink in linklists[link_handle].links -%}
              {%- if forloop.first == true -%}
                {%- assign level = level | plus: 1 -%}
              {%- endif -%}
              {% assign clink_handle = clink.title | handle %}
              {%- assign link_titles = link_titles | append: clink.title | append: '|' -%}
              {%- assign link_urls = link_urls | append: clink.url | append: '|' -%}
              {%- assign link_levels = link_levels | append: level | append: '|' -%}
              {%- assign link_parents = link_parents | append: link_handle | append: '|' -%}
              {%- assign handle = link.title | handleize -%}
              {%- assign link_handles = link_handles | append: clink_handle | append: '|' -%}

              {%- if linklist_titles contains clink_handle -%}
                {%- for gclink in linklists[clink_handle].links -%}
                  {%- if forloop.first == true -%}
                    {%- assign level = level | plus: 1 -%}
                  {%- endif -%}

                  {% assign gclink_handle = gclink.title | handle %}
                  {%- assign link_titles = link_titles | append: gclink.title | append: '|' -%}
                  {%- assign link_urls = link_urls | append: gclink.url | append: '|' -%}
                  {%- assign link_levels = link_levels | append: level | append: '|' -%}
                  {%- assign link_parents = link_parents | append: gclink_handle | append: '|' -%}
                  {%- assign link_handles = link_handles | append: gclink_handle | append: '|' -%}

                  {%- if forloop.last == true -%}
                    {%- assign level = level | minus: 1 -%}
                  {%- endif -%}
                {%- endfor -%}
              {%- endif -%}
              {%- if forloop.last == true -%}
                {%- assign level = level | minus: 1 -%}
              {%- endif -%}
            {%- endfor -%}
          {%- endif -%}
        {%- endfor -%}

        {%- comment -%} CONVERT TO ARRAYS {%- endcomment -%}
        {%- assign str_size = link_levels | size | minus: 1 -%}
        {%- assign llevels = link_levels | slice: 0, str_size | split: '|' -%}

        {%- assign str_size = link_titles | size | minus: 1 -%}
        {%- assign ltitles = link_titles | slice: 0, str_size | split: '|' -%}

        {%- assign str_size = link_handles | size | minus: 1 -%}
        {%- assign lhandles = link_handles | slice: 0, str_size | split: '|' -%}

        {%- assign str_size = link_parents | size | minus: 1 -%}
        {%- assign lparents = link_parents | slice: 0, str_size | split: '|' -%}

        {%- assign str_size = link_urls | size | minus: 1 -%}
        {%- assign lurls = link_urls | slice: 0, str_size | split: '|' -%}

        {%- assign depth = '3' -%}
        {%- assign bc3_parent_list_handle = '' %}

        {%- for url in lurls -%}
          {%- if object_urls contains url and llevels[forloop.index0] == depth -%}
            {%- unless url == product.url or url == collection.url -%}
              {%- capture bc3 -%}
              {{ ltitles[forloop.index0] | link_to: url, ltitles[forloop.index0] }}{%- endcapture -%}
            {%- endunless -%}
            {%- assign bc3_parent_list_handle = lparents[forloop.index0] -%}
            {%- assign bc3_list_handle = lhandles[forloop.index0] -%}
            {% break %}
          {%- endif -%}
        {%- endfor -%}

        {%- assign depth = '2' -%}
        {%- assign bc2_parent_list_handle = '' %}

        {%- if bc3_parent_list_handle == '' -%}
          {%- for url in lurls -%}
            {%- if llevels[forloop.index0] == depth -%}
              {%- if object_urls contains url -%}
                {%- unless url == product.url or url == collection.url -%}
                  {%- capture bc2 -%}
                  {{ ltitles[forloop.index0] | link_to: url, ltitles[forloop.index0] }}{%- endcapture -%}
                {% endunless %}
                {%- assign bc2_parent_list_handle = lparents[forloop.index0] -%}
                {%- break -%}
              {%- endif -%}
            {%- endif -%}
          {%- endfor -%}
        {%- else -%}
          {%- for list_handle in lhandles -%}
            {%- if list_handle == bc3_parent_list_handle -%}
              {% assign bc2_list_handle = list_handle %}
              {%- assign bc2_parent_list_handle = lparents[forloop.index0] -%}
              {%- assign bc2_list_title = ltitles[forloop.index0] -%}
              {%- for bc2_sibling_link in linklists[bc2_parent_list_handle].links -%}
                {%- assign bc2_sibling_title_handleized = bc2_sibling_link.title | handle -%}
                {% if bc2_sibling_title_handleized == bc2_list_handle %}
                  {%- capture bc2 -%}
                  {{ bc2_sibling_link.title | link_to: bc2_sibling_link.url, bc2_sibling_link.title }}{%- endcapture -%}
                  {% break %}
                {%- endif -%}
              {%- endfor -%}
              {% break %}
            {%- endif -%}
          {%- endfor -%}
        {%- endif -%}

        {%- assign depth = depth | minus: 1 | append: '' -%}
        {%- assign bc1_parent_list_handle = '' %}

        {%- if bc2_parent_list_handle == '' -%}
          {% for url in lurls %}
            {%- if object_urls contains url and llevels[forloop.index0] == depth -%}
              {%- unless url == product.url or url == collection.url -%}
                {%- capture bc1 -%}
                {{ ltitles[forloop.index0] | link_to: url, ltitles[forloop.index0] }}{%- endcapture -%}
              {% endunless %}
              {%- assign bc1_parent_list_handle = lparents[forloop.index0] -%}
              {%- break -%}
            {%- endif -%}
          {%- endfor -%}

        {%- else -%}
          {%- for list_handle in lhandles -%}
            {%- if bc2_parent_list_handle == list_handle -%}
              {% assign bc1_list_handle = list_handle %}
              {%- assign bc1_parent_list_handle = lparents[forloop.index0] -%}
              {%- assign bc1_title = ltitles[forloop.index0] -%}
              {%- for bc1_sibling_link in linklists[bc1_parent_list_handle].links -%}
                {%- assign bc1_sibling_title_handleized = bc1_sibling_link.title | handle -%}
                {% if bc1_sibling_title_handleized == bc1_list_handle %}
                  {%- capture bc1 -%}
                  {{ bc1_sibling_link.title | link_to: bc1_sibling_link.url, bc1_sibling_link.title }}{%- endcapture -%}
                  {% break %}
                {%- endif -%}
              {%- endfor -%}
            {%- endif -%}
          {%- endfor -%}
        {%- endif -%}

        {%- if bc1 -%}
          
          
          {{ bc1 }}
        {%- endif -%}
        {%- if bc2 -%}
          
          {{ bc2 }}
        {%- endif -%}
        {%- if bc3 -%}
          
          {{ bc3 }}
        {%- endif -%}

        
        {{ product.title }}
      {%- else -%}
        {% for link in linklists['main-menu'].links %}
          {% if link.child_active or link.active %}
            
            
            
              {{ link.title | escape }}
            
            {% for clink in link.links %}
              {% if clink.child_active or clink.active %}
                
                
                  {{ clink.title | escape }}
                
                {% for gclink in clink.links %}
                  {% if gclink.child_active or gclink.active %}
                    
                    
                      {{ gclink.title | escape }}
                    
                  {% endif %}
                {%- endfor -%}
              {% endif %}
            {%- endfor -%}
          {% endif %}
        {%- endfor -%}
    {%- endcase -%}
  {%- endunless -%}

{% schema %}
{
  "name": "Breadcrumb Navigation",
  "settings": [
    {
      "type": "checkbox",
      "id": "breadcrumbs_home_icon_bool",
      "label": "Use the home icon next to the Home link in the breadcrumb",
      "default": true
    },
    {
      "type": "select",
      "id": "breadcrumb_delimeter",
      "label": "Breadcrumb Delimeter Icon",
      "options": [
        {
          "value": "angle_right",
          "label": "Angle Right"
        },
        {
          "value": "slash",
          "label": "Slash"
        },
        {
          "value": "arrow_right",
          "label": "Arrow Right"
        },
        {
          "value": "squiggle_arrow",
          "label": "Squiggle Arrow"
        }, {
          "value": "right_long",
          "label": "Right Long"
        }, {
          "value": "double_right",
          "label": "Double Right"
        }, {
          "value": "diamond_arrow_head",
          "label": "Diamond Arrow Head"
        }, {
          "value": "heavy_angle_right",
          "label": "Heavy Angle Right"
        }
      ],
      "default": "angle_right"
    },
    {
      "type": "color",
      "id": "breadcrumb_bg_color",
      "label": "Background Color",
      "default": "#fff"
    }, {
      "type": "color",
      "id": "breadcrumb_text_color",
      "label": "Breadcrumb Color",
      "default": "#465076"
    },
  {
        "type": "checkbox",
        "id": "breadcrumb_accent_color_bool",
        "label": "Enable visited page color link in breadcrumb",
        "default": false
      }, {
        "type": "color",
        "id": "breadcrumb_accent_color",
        "label": "Visited Page Link Color",
        "default": "#4770db"
      },
  {
    "type":"checkbox",
    "id":"enable_product_page",
    "label":"Enable in Product Page"
  },
    {
    "type":"checkbox",
    "id":"enable_collection_page",
    "label":"Enable in Collection Page"
  },
     {
    "type":"checkbox",
    "id":"enable_complete_site",
    "label":"Enable on Complete Website",
    "default": true
  }
  ],
  "presets": [
    {
      "name": "Breadcrumb Navigation"
    }
  ]
}
{% endschema %}

@Boomdeleon the site does not need to be live I just want to inspect the site to remove the main collections part on your product page. Please share your store url and password ce it’s in development.

By the way are you using any app or something for breadcrumbs as I believe dawn or mostly any free theme does not provide breadcrumbs section?

Here’s the code I’m using

{%- style -%}
  {% if section.settings.enable_complete_site %}
    .breadcrumbs{
      display: block;
    }
    {% endif %}

  {% if template == 'collection' and section.settings.enable_collection_page  %}
     .breadcrumbs{
       display: block;
     }
   {% endif %}

       :root  {
         --svg_fill: {{ section.settings.breadcrumb_text_color}}
         ;
       }

       .home-icon-container {
         display: inline-block;
         margin-right: 4px;
         vertical-align: sub;
       }

       .breadcrumbs {
         padding: 1rem 5rem;
         color: {{ section.settings.breadcrumb_text_color }}
         ;
         background-color: {{ section.settings.breadcrumb_bg_color }}
       }

       .breadcrumbs li {
         display: inline-block;
       }

       .breadcrumbs a {
         text-decoration: none;
         /*Will put liquid customization here*/
         font-size: 12px;
         color: inherit;
       }

     {%- if section.settings.breadcrumb_accent_color_bool -%}
         .breadcrumbs a:last-of-type {
           color: {{ section.settings.breadcrumb_accent_color }}
            !important;
         }
       {%- endif -%}

       .breadcrumb-delimeter:not(:last-child):after {
         {%- case section.settings.breadcrumb_delimeter -%}
           {%- when "angle_right" -%}
           content: "›";
           font-size: 18px;
           {%- when "slash" -%}
           content: "/";
           font-size: 12px;
           {%- when "arrow_right" -%}
           content: "➤";
           font-size: 15px;
           {%- when "squiggle_arrow" -%}
           content: "\27FF";
           font-size: 25px;
           {%- when "right_long" -%}
           content: "\279E";
           font-size: 18px;
           transform: translateY(5%);
           {%- when "double_right" -%}
           content: "\00BB";
           font-size: 20px;
           {%- when "diamond_arrow_head" -%}
           content: "⤞";
           font-size: 25px;
           transform: translateY(5%);
           {%- when "heavy_angle_right" -%}
           content: "\276F";
           font-size: 18px;
           transform: translateY(5%);
         {%- else -%}

         {%- endcase -%}
         display: inline-block;
         margin-left: 0.75rem;
         margin-right: 0.50rem;
         speak: none;
       }

       .breadcrumbs [aria-current="page"] {
         color: inherit;
         font-weight: normal;
         text-decoration: none;
       }
{%- endstyle -%}

  {%- unless template == 'index' or template == 'cart' -%}
    {%- if section.settings.breadcrumbs_home_icon_bool -%}
      

        
      

    {%- endif -%}

    Home
    {%- case template.name -%}
      {%- when 'article' -%}
        {%- for link in linklists['main-menu'].links -%}
          {%- if link.url == blog.url -%}
            
            
            {{ link.title | link_to: link.url }}
            {% break %}
          {%- endif -%}
        {%- endfor -%}
        
        {{ article.title }}
      {%- when 'product' -%}
        {%- capture product_url_string -%}
        {%- for collection in product.collections -%}
          {{ collection.url }}|
        {%- endfor -%}
      {%- endcapture -%}

        {%- assign object_url_string = product_url_string | append: product.url -%}

        {%- assign object_urls = object_url_string | split: '|' -%}
        {%- capture linklist_titles_str -%}
        {%- for linklist in linklists -%}
          {{ linklist.title | handleize }}|{%- endfor -%}
      {%- endcapture -%}
        {%- assign str_size = linklist_titles_str | size | minus: 1 -%}
        {%- assign linklist_titles_str = linklist_titles_str | slice: 0, str_size -%}
        {%- assign linklist_titles = linklist_titles_str | split: '|' -%}

        {%- assign level = 1 -%}
        {%- for link in linklists['main-menu'].links -%}
          {%- assign link_handle = link.title | handle -%}
          {%- assign link_titles = link_titles | append: link.title | append: '|' -%}
          {%- assign link_urls = link_urls | append: link.url | append: '|' -%}
          {%- assign link_levels = link_levels | append: level | append: '|' -%}
          {%- assign link_parents = link_parents | append: 'main-menu' | append: '|' -%}
          {%- assign link_handles = link_handles | append: link_handle | append: '|' -%}

          {%- if linklist_titles contains link_handle -%}
            {%- for clink in linklists[link_handle].links -%}
              {%- if forloop.first == true -%}
                {%- assign level = level | plus: 1 -%}
              {%- endif -%}
              {% assign clink_handle = clink.title | handle %}
              {%- assign link_titles = link_titles | append: clink.title | append: '|' -%}
              {%- assign link_urls = link_urls | append: clink.url | append: '|' -%}
              {%- assign link_levels = link_levels | append: level | append: '|' -%}
              {%- assign link_parents = link_parents | append: link_handle | append: '|' -%}
              {%- assign handle = link.title | handleize -%}
              {%- assign link_handles = link_handles | append: clink_handle | append: '|' -%}

              {%- if linklist_titles contains clink_handle -%}
                {%- for gclink in linklists[clink_handle].links -%}
                  {%- if forloop.first == true -%}
                    {%- assign level = level | plus: 1 -%}
                  {%- endif -%}

                  {% assign gclink_handle = gclink.title | handle %}
                  {%- assign link_titles = link_titles | append: gclink.title | append: '|' -%}
                  {%- assign link_urls = link_urls | append: gclink.url | append: '|' -%}
                  {%- assign link_levels = link_levels | append: level | append: '|' -%}
                  {%- assign link_parents = link_parents | append: gclink_handle | append: '|' -%}
                  {%- assign link_handles = link_handles | append: gclink_handle | append: '|' -%}

                  {%- if forloop.last == true -%}
                    {%- assign level = level | minus: 1 -%}
                  {%- endif -%}
                {%- endfor -%}
              {%- endif -%}
              {%- if forloop.last == true -%}
                {%- assign level = level | minus: 1 -%}
              {%- endif -%}
            {%- endfor -%}
          {%- endif -%}
        {%- endfor -%}

        {%- comment -%} CONVERT TO ARRAYS {%- endcomment -%}
        {%- assign str_size = link_levels | size | minus: 1 -%}
        {%- assign llevels = link_levels | slice: 0, str_size | split: '|' -%}

        {%- assign str_size = link_titles | size | minus: 1 -%}
        {%- assign ltitles = link_titles | slice: 0, str_size | split: '|' -%}

        {%- assign str_size = link_handles | size | minus: 1 -%}
        {%- assign lhandles = link_handles | slice: 0, str_size | split: '|' -%}

        {%- assign str_size = link_parents | size | minus: 1 -%}
        {%- assign lparents = link_parents | slice: 0, str_size | split: '|' -%}

        {%- assign str_size = link_urls | size | minus: 1 -%}
        {%- assign lurls = link_urls | slice: 0, str_size | split: '|' -%}

        {%- assign depth = '3' -%}
        {%- assign bc3_parent_list_handle = '' %}

        {%- for url in lurls -%}
          {%- if object_urls contains url and llevels[forloop.index0] == depth -%}
            {%- unless url == product.url or url == collection.url -%}
              {%- capture bc3 -%}
              {{ ltitles[forloop.index0] | link_to: url, ltitles[forloop.index0] }}{%- endcapture -%}
            {%- endunless -%}
            {%- assign bc3_parent_list_handle = lparents[forloop.index0] -%}
            {%- assign bc3_list_handle = lhandles[forloop.index0] -%}
            {% break %}
          {%- endif -%}
        {%- endfor -%}

        {%- assign depth = '2' -%}
        {%- assign bc2_parent_list_handle = '' %}

        {%- if bc3_parent_list_handle == '' -%}
          {%- for url in lurls -%}
            {%- if llevels[forloop.index0] == depth -%}
              {%- if object_urls contains url -%}
                {%- unless url == product.url or url == collection.url -%}
                  {%- capture bc2 -%}
                  {{ ltitles[forloop.index0] | link_to: url, ltitles[forloop.index0] }}{%- endcapture -%}
                {% endunless %}
                {%- assign bc2_parent_list_handle = lparents[forloop.index0] -%}
                {%- break -%}
              {%- endif -%}
            {%- endif -%}
          {%- endfor -%}
        {%- else -%}
          {%- for list_handle in lhandles -%}
            {%- if list_handle == bc3_parent_list_handle -%}
              {% assign bc2_list_handle = list_handle %}
              {%- assign bc2_parent_list_handle = lparents[forloop.index0] -%}
              {%- assign bc2_list_title = ltitles[forloop.index0] -%}
              {%- for bc2_sibling_link in linklists[bc2_parent_list_handle].links -%}
                {%- assign bc2_sibling_title_handleized = bc2_sibling_link.title | handle -%}
                {% if bc2_sibling_title_handleized == bc2_list_handle %}
                  {%- capture bc2 -%}
                  {{ bc2_sibling_link.title | link_to: bc2_sibling_link.url, bc2_sibling_link.title }}{%- endcapture -%}
                  {% break %}
                {%- endif -%}
              {%- endfor -%}
              {% break %}
            {%- endif -%}
          {%- endfor -%}
        {%- endif -%}

        {%- assign depth = depth | minus: 1 | append: '' -%}
        {%- assign bc1_parent_list_handle = '' %}

        {%- if bc2_parent_list_handle == '' -%}
          {% for url in lurls %}
            {%- if object_urls contains url and llevels[forloop.index0] == depth -%}
              {%- unless url == product.url or url == collection.url -%}
                {%- capture bc1 -%}
                {{ ltitles[forloop.index0] | link_to: url, ltitles[forloop.index0] }}{%- endcapture -%}
              {% endunless %}
              {%- assign bc1_parent_list_handle = lparents[forloop.index0] -%}
              {%- break -%}
            {%- endif -%}
          {%- endfor -%}

        {%- else -%}
          {%- for list_handle in lhandles -%}
            {%- if bc2_parent_list_handle == list_handle -%}
              {% assign bc1_list_handle = list_handle %}
              {%- assign bc1_parent_list_handle = lparents[forloop.index0] -%}
              {%- assign bc1_title = ltitles[forloop.index0] -%}
              {%- for bc1_sibling_link in linklists[bc1_parent_list_handle].links -%}
                {%- assign bc1_sibling_title_handleized = bc1_sibling_link.title | handle -%}
                {% if bc1_sibling_title_handleized == bc1_list_handle %}
                  {%- capture bc1 -%}
                  {{ bc1_sibling_link.title | link_to: bc1_sibling_link.url, bc1_sibling_link.title }}{%- endcapture -%}
                  {% break %}
                {%- endif -%}
              {%- endfor -%}
            {%- endif -%}
          {%- endfor -%}
        {%- endif -%}

        {%- if bc1 -%}
          
          
          {{ bc1 }}
        {%- endif -%}
        {%- if bc2 -%}
          
          {{ bc2 }}
        {%- endif -%}
        {%- if bc3 -%}
          
          {{ bc3 }}
        {%- endif -%}

        
        {{ product.title }}
      {%- else -%}
        {% for link in linklists['main-menu'].links %}
          {% if link.child_active or link.active %}
            
            
            
              {{ link.title | escape }}
            
            {% for clink in link.links %}
              {% if clink.child_active or clink.active %}
                
                
                  {{ clink.title | escape }}
                
                {% for gclink in clink.links %}
                  {% if gclink.child_active or gclink.active %}
                    
                    
                      {{ gclink.title | escape }}
                    
                  {% endif %}
                {%- endfor -%}
              {% endif %}
            {%- endfor -%}
          {% endif %}
        {%- endfor -%}
    {%- endcase -%}
  {%- endunless -%}

{% schema %}
{
  "name": "Breadcrumb Navigation",
  "settings": [
    {
      "type": "checkbox",
      "id": "breadcrumbs_home_icon_bool",
      "label": "Use the home icon next to the Home link in the breadcrumb",
      "default": true
    },
    {
      "type": "select",
      "id": "breadcrumb_delimeter",
      "label": "Breadcrumb Delimeter Icon",
      "options": [
        {
          "value": "angle_right",
          "label": "Angle Right"
        },
        {
          "value": "slash",
          "label": "Slash"
        },
        {
          "value": "arrow_right",
          "label": "Arrow Right"
        },
        {
          "value": "squiggle_arrow",
          "label": "Squiggle Arrow"
        }, {
          "value": "right_long",
          "label": "Right Long"
        }, {
          "value": "double_right",
          "label": "Double Right"
        }, {
          "value": "diamond_arrow_head",
          "label": "Diamond Arrow Head"
        }, {
          "value": "heavy_angle_right",
          "label": "Heavy Angle Right"
        }
      ],
      "default": "angle_right"
    },
    {
      "type": "color",
      "id": "breadcrumb_bg_color",
      "label": "Background Color",
      "default": "#fff"
    }, {
      "type": "color",
      "id": "breadcrumb_text_color",
      "label": "Breadcrumb Color",
      "default": "#465076"
    },
  {
        "type": "checkbox",
        "id": "breadcrumb_accent_color_bool",
        "label": "Enable visited page color link in breadcrumb",
        "default": false
      }, {
        "type": "color",
        "id": "breadcrumb_accent_color",
        "label": "Visited Page Link Color",
        "default": "#4770db"
      },
  {
    "type":"checkbox",
    "id":"enable_product_page",
    "label":"Enable in Product Page"
  },
    {
    "type":"checkbox",
    "id":"enable_collection_page",
    "label":"Enable in Collection Page"
  },
     {
    "type":"checkbox",
    "id":"enable_complete_site",
    "label":"Enable on Complete Website",
    "default": true
  }
  ],
  "presets": [
    {
      "name": "Breadcrumb Navigation"
    }
  ]
}
{% endschema %}

@Boomdeleon replace this code of breadcrumbs with this.

{%- style -%}
{% if template == ‘product’ and section.settings.enable_product_page %}
.breadcrumbs{
display: block;
}
.breadcrumbs a[href=“/collections”] {
display: none;
}

/* Hide the immediate span tag after the hidden anchor */
.breadcrumbs a[href=“/collections”] + .breadcrumb-delimeter {
display: none;
}
{% else %}
.breadcrumbs{
display: none;
}
{% endif %}

{% if section.settings.enable_complete_site %}
.breadcrumbs{
display: block;
}
{% endif %}

{% if template == ‘collection’ and section.settings.enable_collection_page %}
.breadcrumbs{
display: block;
}
{% endif %}

:root {
–svg_fill: {{ section.settings.breadcrumb_text_color}}
;
}

.home-icon-container {
display: inline-block;
margin-right: 4px;
vertical-align: sub;
}

.breadcrumbs {
padding: 1rem 5rem;
color: {{ section.settings.breadcrumb_text_color }}
;
background-color: {{ section.settings.breadcrumb_bg_color }}
}

.breadcrumbs li {
display: inline-block;
}

.breadcrumbs a {
text-decoration: none;
/Will put liquid customization here/
font-size: 15px;
color: inherit;
}

{%- if section.settings.breadcrumb_accent_color_bool -%}
.breadcrumbs a:last-of-type {
color: {{ section.settings.breadcrumb_accent_color }}
!important;
}
{%- endif -%}

.breadcrumb-delimeter:not(:last-child):after {
{%- case section.settings.breadcrumb_delimeter -%}
{%- when “angle_right” -%}
content: “›”;
font-size: 18px;
{%- when “slash” -%}
content: “/”;
font-size: 16px;
{%- when “arrow_right” -%}
content: “➤”;
font-size: 15px;
{%- when “squiggle_arrow” -%}
content: “\27FF”;
font-size: 25px;
{%- when “right_long” -%}
content: “\279E”;
font-size: 18px;
transform: translateY(5%);
{%- when “double_right” -%}
content: “\00BB”;
font-size: 20px;
{%- when “diamond_arrow_head” -%}
content: “⤞”;
font-size: 25px;
transform: translateY(5%);
{%- when “heavy_angle_right” -%}
content: “\276F”;
font-size: 18px;
transform: translateY(5%);
{%- else -%}

{%- endcase -%}
display: inline-block;
margin-left: 0.75rem;
margin-right: 0.50rem;
speak: none;
}

.breadcrumbs [aria-current=“page”] {
color: inherit;
font-weight: normal;
text-decoration: none;
}
{%- endstyle -%}

{%- unless template == 'index' or template == 'cart' -%} {%- if section.settings.breadcrumbs_home_icon_bool -%}
{%- endif -%}

Home
{%- case template.name -%}
{%- when ‘article’ -%}
{%- for link in linklists[‘main-menu’].links -%}
{%- if link.url == blog.url -%}

{{ link.title | link_to: link.url }}
{% break %}
{%- endif -%}
{%- endfor -%}

{{ article.title }}
{%- when ‘product’ -%}
{%- capture product_url_string -%}
{%- for collection in product.collections -%}
{{ collection.url }}|
{%- endfor -%}
{%- endcapture -%}

{%- assign object_url_string = product_url_string | append: product.url -%}

{%- assign object_urls = object_url_string | split: ‘|’ -%}
{%- capture linklist_titles_str -%}
{%- for linklist in linklists -%}
{{ linklist.title | handleize }}|{%- endfor -%}
{%- endcapture -%}
{%- assign str_size = linklist_titles_str | size | minus: 1 -%}
{%- assign linklist_titles_str = linklist_titles_str | slice: 0, str_size -%}
{%- assign linklist_titles = linklist_titles_str | split: ‘|’ -%}

{%- assign level = 1 -%}
{%- for link in linklists[‘main-menu’].links -%}
{%- assign link_handle = link.title | handle -%}
{%- assign link_titles = link_titles | append: link.title | append: ‘|’ -%}
{%- assign link_urls = link_urls | append: link.url | append: ‘|’ -%}
{%- assign link_levels = link_levels | append: level | append: ‘|’ -%}
{%- assign link_parents = link_parents | append: ‘main-menu’ | append: ‘|’ -%}
{%- assign link_handles = link_handles | append: link_handle | append: ‘|’ -%}

{%- if linklist_titles contains link_handle -%}
{%- for clink in linklists[link_handle].links -%}
{%- if forloop.first == true -%}
{%- assign level = level | plus: 1 -%}
{%- endif -%}
{% assign clink_handle = clink.title | handle %}
{%- assign link_titles = link_titles | append: clink.title | append: ‘|’ -%}
{%- assign link_urls = link_urls | append: clink.url | append: ‘|’ -%}
{%- assign link_levels = link_levels | append: level | append: ‘|’ -%}
{%- assign link_parents = link_parents | append: link_handle | append: ‘|’ -%}
{%- assign handle = link.title | handleize -%}
{%- assign link_handles = link_handles | append: clink_handle | append: ‘|’ -%}

{%- if linklist_titles contains clink_handle -%}
{%- for gclink in linklists[clink_handle].links -%}
{%- if forloop.first == true -%}
{%- assign level = level | plus: 1 -%}
{%- endif -%}

{% assign gclink_handle = gclink.title | handle %}
{%- assign link_titles = link_titles | append: gclink.title | append: ‘|’ -%}
{%- assign link_urls = link_urls | append: gclink.url | append: ‘|’ -%}
{%- assign link_levels = link_levels | append: level | append: ‘|’ -%}
{%- assign link_parents = link_parents | append: gclink_handle | append: ‘|’ -%}
{%- assign link_handles = link_handles | append: gclink_handle | append: ‘|’ -%}

{%- if forloop.last == true -%}
{%- assign level = level | minus: 1 -%}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- if forloop.last == true -%}
{%- assign level = level | minus: 1 -%}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- endfor -%}

{%- comment -%} CONVERT TO ARRAYS {%- endcomment -%}
{%- assign str_size = link_levels | size | minus: 1 -%}
{%- assign llevels = link_levels | slice: 0, str_size | split: ‘|’ -%}

{%- assign str_size = link_titles | size | minus: 1 -%}
{%- assign ltitles = link_titles | slice: 0, str_size | split: ‘|’ -%}

{%- assign str_size = link_handles | size | minus: 1 -%}
{%- assign lhandles = link_handles | slice: 0, str_size | split: ‘|’ -%}

{%- assign str_size = link_parents | size | minus: 1 -%}
{%- assign lparents = link_parents | slice: 0, str_size | split: ‘|’ -%}

{%- assign str_size = link_urls | size | minus: 1 -%}
{%- assign lurls = link_urls | slice: 0, str_size | split: ‘|’ -%}

{%- assign depth = ‘3’ -%}
{%- assign bc3_parent_list_handle = ‘’ %}

{%- for url in lurls -%}
{%- if object_urls contains url and llevels[forloop.index0] == depth -%}
{%- unless url == product.url or url == collection.url -%}
{%- capture bc3 -%}
{{ ltitles[forloop.index0] | link_to: url, ltitles[forloop.index0] }}{%- endcapture -%}
{%- endunless -%}
{%- assign bc3_parent_list_handle = lparents[forloop.index0] -%}
{%- assign bc3_list_handle = lhandles[forloop.index0] -%}
{% break %}
{%- endif -%}
{%- endfor -%}

{%- assign depth = ‘2’ -%}
{%- assign bc2_parent_list_handle = ‘’ %}

{%- if bc3_parent_list_handle == ‘’ -%}
{%- for url in lurls -%}
{%- if llevels[forloop.index0] == depth -%}
{%- if object_urls contains url -%}
{%- unless url == product.url or url == collection.url -%}
{%- capture bc2 -%}
{{ ltitles[forloop.index0] | link_to: url, ltitles[forloop.index0] }}{%- endcapture -%}
{% endunless %}
{%- assign bc2_parent_list_handle = lparents[forloop.index0] -%}
{%- break -%}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{%- else -%}
{%- for list_handle in lhandles -%}
{%- if list_handle == bc3_parent_list_handle -%}
{% assign bc2_list_handle = list_handle %}
{%- assign bc2_parent_list_handle = lparents[forloop.index0] -%}
{%- assign bc2_list_title = ltitles[forloop.index0] -%}
{%- for bc2_sibling_link in linklists[bc2_parent_list_handle].links -%}
{%- assign bc2_sibling_title_handleized = bc2_sibling_link.title | handle -%}
{% if bc2_sibling_title_handleized == bc2_list_handle %}
{%- capture bc2 -%}
{{ bc2_sibling_link.title | link_to: bc2_sibling_link.url, bc2_sibling_link.title }}{%- endcapture -%}
{% break %}
{%- endif -%}
{%- endfor -%}
{% break %}
{%- endif -%}
{%- endfor -%}
{%- endif -%}

{%- assign depth = depth | minus: 1 | append: ‘’ -%}
{%- assign bc1_parent_list_handle = ‘’ %}

{%- if bc2_parent_list_handle == ‘’ -%}
{% for url in lurls %}
{%- if object_urls contains url and llevels[forloop.index0] == depth -%}
{%- unless url == product.url or url == collection.url -%}
{%- capture bc1 -%}
{{ ltitles[forloop.index0] | link_to: url, ltitles[forloop.index0] }}{%- endcapture -%}
{% endunless %}
{%- assign bc1_parent_list_handle = lparents[forloop.index0] -%}
{%- break -%}
{%- endif -%}
{%- endfor -%}

{%- else -%}
{%- for list_handle in lhandles -%}
{%- if bc2_parent_list_handle == list_handle -%}
{% assign bc1_list_handle = list_handle %}
{%- assign bc1_parent_list_handle = lparents[forloop.index0] -%}
{%- assign bc1_title = ltitles[forloop.index0] -%}
{%- for bc1_sibling_link in linklists[bc1_parent_list_handle].links -%}
{%- assign bc1_sibling_title_handleized = bc1_sibling_link.title | handle -%}
{% if bc1_sibling_title_handleized == bc1_list_handle %}
{%- capture bc1 -%}
{{ bc1_sibling_link.title | link_to: bc1_sibling_link.url, bc1_sibling_link.title }}{%- endcapture -%}
{% break %}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- endfor -%}
{%- endif -%}

{%- if bc1 -%}

{{ bc1 }}
{%- endif -%}
{%- if bc2 -%}

{{ bc2 }}
{%- endif -%}
{%- if bc3 -%}

{{ bc3 }}
{%- endif -%}


{{ product.title }}
{%- else -%}
{% for link in linklists[‘main-menu’].links %}
{% if link.child_active or link.active %}

{{ link.title | escape }} {% for clink in link.links %} {% if clink.child_active or clink.active %} {{ clink.title | escape }} {% for gclink in clink.links %} {% if gclink.child_active or gclink.active %} {{ gclink.title | escape }} {% endif %} {%- endfor -%} {% endif %} {%- endfor -%} {% endif %} {%- endfor -%} {%- endcase -%} {%- endunless -%}

{% schema %}
{
“name”: “Breadcrumb Navigation”,
“settings”: [
{
“type”: “header”,
“content”: “Subscribe to our channel
},
{
“type”: “checkbox”,
“id”: “breadcrumbs_home_icon_bool”,
“label”: “Use the home icon next to the Home link in the breadcrumb”,
“default”: true
},
{
“type”: “select”,
“id”: “breadcrumb_delimeter”,
“label”: “Breadcrumb Delimeter Icon”,
“options”: [
{
“value”: “angle_right”,
“label”: “Angle Right”
},
{
“value”: “slash”,
“label”: “Slash”
},
{
“value”: “arrow_right”,
“label”: “Arrow Right”
},
{
“value”: “squiggle_arrow”,
“label”: “Squiggle Arrow”
}, {
“value”: “right_long”,
“label”: “Right Long”
}, {
“value”: “double_right”,
“label”: “Double Right”
}, {
“value”: “diamond_arrow_head”,
“label”: “Diamond Arrow Head”
}, {
“value”: “heavy_angle_right”,
“label”: “Heavy Angle Right”
}
],
“default”: “angle_right”
},
{
“type”: “color”,
“id”: “breadcrumb_bg_color”,
“label”: “Background Color”,
“default”: “#fff
}, {
“type”: “color”,
“id”: “breadcrumb_text_color”,
“label”: “Breadcrumb Color”,
“default”: “#465076
},
{
“type”: “checkbox”,
“id”: “breadcrumb_accent_color_bool”,
“label”: “Enable visited page color link in breadcrumb”,
“default”: false
}, {
“type”: “color”,
“id”: “breadcrumb_accent_color”,
“label”: “Visited Page Link Color”,
“default”: “#4770db
},
{
“type”:“checkbox”,
“id”:“enable_product_page”,
“label”:“Enable in Product Page”
},
{
“type”:“checkbox”,
“id”:“enable_collection_page”,
“label”:“Enable in Collection Page”
},
{
“type”:“checkbox”,
“id”:“enable_complete_site”,
“label”:“Enable on Complete Website”,
“default”: true
}
],
“presets”: [
{
“name”: “Breadcrumb Navigation”
}
]
}
{% endschema %}

This should hide the main collections link in your product page and only show the collection your product belongs to. Let me know if you run into any issues.

If this helps your cause please like and mark it as solution.

for any help or queries in future with shopify or any other platform for creating sites and landing pages or custom solutions like this.

Email ME

Buy me Coffee if this helps you. Would be motivating to continue providing solutions.

Thanks anyways

this didn’t work…

@Boomdeleon Try this

{%- style -%}
{% if template == ‘product’ and section.settings.enable_product_page %}
.breadcrumbs{
display: block;
}
.breadcrumbs a[title=“BMI Scales Categories”] {
display: none;
}

/* Hide the immediate span tag after the hidden anchor */
.breadcrumbs a[title=“BMI Scales Categories”] + .breadcrumb-delimeter {
display: none;
}
{% else %}
.breadcrumbs{
display: none;
}
{% endif %}

{% if section.settings.enable_complete_site %}
.breadcrumbs{
display: block;
}
{% endif %}

{% if template == ‘collection’ and section.settings.enable_collection_page %}
.breadcrumbs{
display: block;
}
{% endif %}

:root {
–svg_fill: {{ section.settings.breadcrumb_text_color}}
;
}

.home-icon-container {
display: inline-block;
margin-right: 4px;
vertical-align: sub;
}

.breadcrumbs {
padding: 1rem 5rem;
color: {{ section.settings.breadcrumb_text_color }}
;
background-color: {{ section.settings.breadcrumb_bg_color }}
}

.breadcrumbs li {
display: inline-block;
}

.breadcrumbs a {
text-decoration: none;
/Will put liquid customization here/
font-size: 15px;
color: inherit;
}

{%- if section.settings.breadcrumb_accent_color_bool -%}
.breadcrumbs a:last-of-type {
color: {{ section.settings.breadcrumb_accent_color }}
!important;
}
{%- endif -%}

.breadcrumb-delimeter:not(:last-child):after {
{%- case section.settings.breadcrumb_delimeter -%}
{%- when “angle_right” -%}
content: “›”;
font-size: 18px;
{%- when “slash” -%}
content: “/”;
font-size: 16px;
{%- when “arrow_right” -%}
content: “➤”;
font-size: 15px;
{%- when “squiggle_arrow” -%}
content: “\27FF”;
font-size: 25px;
{%- when “right_long” -%}
content: “\279E”;
font-size: 18px;
transform: translateY(5%);
{%- when “double_right” -%}
content: “\00BB”;
font-size: 20px;
{%- when “diamond_arrow_head” -%}
content: “⤞”;
font-size: 25px;
transform: translateY(5%);
{%- when “heavy_angle_right” -%}
content: “\276F”;
font-size: 18px;
transform: translateY(5%);
{%- else -%}

{%- endcase -%}
display: inline-block;
margin-left: 0.75rem;
margin-right: 0.50rem;
speak: none;
}

.breadcrumbs [aria-current=“page”] {
color: inherit;
font-weight: normal;
text-decoration: none;
}
{%- endstyle -%}

{%- unless template == 'index' or template == 'cart' -%} {%- if section.settings.breadcrumbs_home_icon_bool -%}
{%- endif -%}

Home
{%- case template.name -%}
{%- when ‘article’ -%}
{%- for link in linklists[‘main-menu’].links -%}
{%- if link.url == blog.url -%}

{{ link.title | link_to: link.url }}
{% break %}
{%- endif -%}
{%- endfor -%}

{{ article.title }}
{%- when ‘product’ -%}
{%- capture product_url_string -%}
{%- for collection in product.collections -%}
{{ collection.url }}|
{%- endfor -%}
{%- endcapture -%}

{%- assign object_url_string = product_url_string | append: product.url -%}

{%- assign object_urls = object_url_string | split: ‘|’ -%}
{%- capture linklist_titles_str -%}
{%- for linklist in linklists -%}
{{ linklist.title | handleize }}|{%- endfor -%}
{%- endcapture -%}
{%- assign str_size = linklist_titles_str | size | minus: 1 -%}
{%- assign linklist_titles_str = linklist_titles_str | slice: 0, str_size -%}
{%- assign linklist_titles = linklist_titles_str | split: ‘|’ -%}

{%- assign level = 1 -%}
{%- for link in linklists[‘main-menu’].links -%}
{%- assign link_handle = link.title | handle -%}
{%- assign link_titles = link_titles | append: link.title | append: ‘|’ -%}
{%- assign link_urls = link_urls | append: link.url | append: ‘|’ -%}
{%- assign link_levels = link_levels | append: level | append: ‘|’ -%}
{%- assign link_parents = link_parents | append: ‘main-menu’ | append: ‘|’ -%}
{%- assign link_handles = link_handles | append: link_handle | append: ‘|’ -%}

{%- if linklist_titles contains link_handle -%}
{%- for clink in linklists[link_handle].links -%}
{%- if forloop.first == true -%}
{%- assign level = level | plus: 1 -%}
{%- endif -%}
{% assign clink_handle = clink.title | handle %}
{%- assign link_titles = link_titles | append: clink.title | append: ‘|’ -%}
{%- assign link_urls = link_urls | append: clink.url | append: ‘|’ -%}
{%- assign link_levels = link_levels | append: level | append: ‘|’ -%}
{%- assign link_parents = link_parents | append: link_handle | append: ‘|’ -%}
{%- assign handle = link.title | handleize -%}
{%- assign link_handles = link_handles | append: clink_handle | append: ‘|’ -%}

{%- if linklist_titles contains clink_handle -%}
{%- for gclink in linklists[clink_handle].links -%}
{%- if forloop.first == true -%}
{%- assign level = level | plus: 1 -%}
{%- endif -%}

{% assign gclink_handle = gclink.title | handle %}
{%- assign link_titles = link_titles | append: gclink.title | append: ‘|’ -%}
{%- assign link_urls = link_urls | append: gclink.url | append: ‘|’ -%}
{%- assign link_levels = link_levels | append: level | append: ‘|’ -%}
{%- assign link_parents = link_parents | append: gclink_handle | append: ‘|’ -%}
{%- assign link_handles = link_handles | append: gclink_handle | append: ‘|’ -%}

{%- if forloop.last == true -%}
{%- assign level = level | minus: 1 -%}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- if forloop.last == true -%}
{%- assign level = level | minus: 1 -%}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- endfor -%}

{%- comment -%} CONVERT TO ARRAYS {%- endcomment -%}
{%- assign str_size = link_levels | size | minus: 1 -%}
{%- assign llevels = link_levels | slice: 0, str_size | split: ‘|’ -%}

{%- assign str_size = link_titles | size | minus: 1 -%}
{%- assign ltitles = link_titles | slice: 0, str_size | split: ‘|’ -%}

{%- assign str_size = link_handles | size | minus: 1 -%}
{%- assign lhandles = link_handles | slice: 0, str_size | split: ‘|’ -%}

{%- assign str_size = link_parents | size | minus: 1 -%}
{%- assign lparents = link_parents | slice: 0, str_size | split: ‘|’ -%}

{%- assign str_size = link_urls | size | minus: 1 -%}
{%- assign lurls = link_urls | slice: 0, str_size | split: ‘|’ -%}

{%- assign depth = ‘3’ -%}
{%- assign bc3_parent_list_handle = ‘’ %}

{%- for url in lurls -%}
{%- if object_urls contains url and llevels[forloop.index0] == depth -%}
{%- unless url == product.url or url == collection.url -%}
{%- capture bc3 -%}
{{ ltitles[forloop.index0] | link_to: url, ltitles[forloop.index0] }}{%- endcapture -%}
{%- endunless -%}
{%- assign bc3_parent_list_handle = lparents[forloop.index0] -%}
{%- assign bc3_list_handle = lhandles[forloop.index0] -%}
{% break %}
{%- endif -%}
{%- endfor -%}

{%- assign depth = ‘2’ -%}
{%- assign bc2_parent_list_handle = ‘’ %}

{%- if bc3_parent_list_handle == ‘’ -%}
{%- for url in lurls -%}
{%- if llevels[forloop.index0] == depth -%}
{%- if object_urls contains url -%}
{%- unless url == product.url or url == collection.url -%}
{%- capture bc2 -%}
{{ ltitles[forloop.index0] | link_to: url, ltitles[forloop.index0] }}{%- endcapture -%}
{% endunless %}
{%- assign bc2_parent_list_handle = lparents[forloop.index0] -%}
{%- break -%}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{%- else -%}
{%- for list_handle in lhandles -%}
{%- if list_handle == bc3_parent_list_handle -%}
{% assign bc2_list_handle = list_handle %}
{%- assign bc2_parent_list_handle = lparents[forloop.index0] -%}
{%- assign bc2_list_title = ltitles[forloop.index0] -%}
{%- for bc2_sibling_link in linklists[bc2_parent_list_handle].links -%}
{%- assign bc2_sibling_title_handleized = bc2_sibling_link.title | handle -%}
{% if bc2_sibling_title_handleized == bc2_list_handle %}
{%- capture bc2 -%}
{{ bc2_sibling_link.title | link_to: bc2_sibling_link.url, bc2_sibling_link.title }}{%- endcapture -%}
{% break %}
{%- endif -%}
{%- endfor -%}
{% break %}
{%- endif -%}
{%- endfor -%}
{%- endif -%}

{%- assign depth = depth | minus: 1 | append: ‘’ -%}
{%- assign bc1_parent_list_handle = ‘’ %}

{%- if bc2_parent_list_handle == ‘’ -%}
{% for url in lurls %}
{%- if object_urls contains url and llevels[forloop.index0] == depth -%}
{%- unless url == product.url or url == collection.url -%}
{%- capture bc1 -%}
{{ ltitles[forloop.index0] | link_to: url, ltitles[forloop.index0] }}{%- endcapture -%}
{% endunless %}
{%- assign bc1_parent_list_handle = lparents[forloop.index0] -%}
{%- break -%}
{%- endif -%}
{%- endfor -%}

{%- else -%}
{%- for list_handle in lhandles -%}
{%- if bc2_parent_list_handle == list_handle -%}
{% assign bc1_list_handle = list_handle %}
{%- assign bc1_parent_list_handle = lparents[forloop.index0] -%}
{%- assign bc1_title = ltitles[forloop.index0] -%}
{%- for bc1_sibling_link in linklists[bc1_parent_list_handle].links -%}
{%- assign bc1_sibling_title_handleized = bc1_sibling_link.title | handle -%}
{% if bc1_sibling_title_handleized == bc1_list_handle %}
{%- capture bc1 -%}
{{ bc1_sibling_link.title | link_to: bc1_sibling_link.url, bc1_sibling_link.title }}{%- endcapture -%}
{% break %}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- endfor -%}
{%- endif -%}

{%- if bc1 -%}

{{ bc1 }}
{%- endif -%}
{%- if bc2 -%}

{{ bc2 }}
{%- endif -%}
{%- if bc3 -%}

{{ bc3 }}
{%- endif -%}


{{ product.title }}
{%- else -%}
{% for link in linklists[‘main-menu’].links %}
{% if link.child_active or link.active %}

{{ link.title | escape }} {% for clink in link.links %} {% if clink.child_active or clink.active %} {{ clink.title | escape }} {% for gclink in clink.links %} {% if gclink.child_active or gclink.active %} {{ gclink.title | escape }} {% endif %} {%- endfor -%} {% endif %} {%- endfor -%} {% endif %} {%- endfor -%} {%- endcase -%} {%- endunless -%}

{% schema %}
{
“name”: “Breadcrumb Navigation”,
“settings”: [
{
“type”: “header”,
“content”: “Subscribe to our channel
},
{
“type”: “checkbox”,
“id”: “breadcrumbs_home_icon_bool”,
“label”: “Use the home icon next to the Home link in the breadcrumb”,
“default”: true
},
{
“type”: “select”,
“id”: “breadcrumb_delimeter”,
“label”: “Breadcrumb Delimeter Icon”,
“options”: [
{
“value”: “angle_right”,
“label”: “Angle Right”
},
{
“value”: “slash”,
“label”: “Slash”
},
{
“value”: “arrow_right”,
“label”: “Arrow Right”
},
{
“value”: “squiggle_arrow”,
“label”: “Squiggle Arrow”
}, {
“value”: “right_long”,
“label”: “Right Long”
}, {
“value”: “double_right”,
“label”: “Double Right”
}, {
“value”: “diamond_arrow_head”,
“label”: “Diamond Arrow Head”
}, {
“value”: “heavy_angle_right”,
“label”: “Heavy Angle Right”
}
],
“default”: “angle_right”
},
{
“type”: “color”,
“id”: “breadcrumb_bg_color”,
“label”: “Background Color”,
“default”: “#fff
}, {
“type”: “color”,
“id”: “breadcrumb_text_color”,
“label”: “Breadcrumb Color”,
“default”: “#465076
},
{
“type”: “checkbox”,
“id”: “breadcrumb_accent_color_bool”,
“label”: “Enable visited page color link in breadcrumb”,
“default”: false
}, {
“type”: “color”,
“id”: “breadcrumb_accent_color”,
“label”: “Visited Page Link Color”,
“default”: “#4770db
},
{
“type”:“checkbox”,
“id”:“enable_product_page”,
“label”:“Enable in Product Page”
},
{
“type”:“checkbox”,
“id”:“enable_collection_page”,
“label”:“Enable in Collection Page”
},
{
“type”:“checkbox”,
“id”:“enable_complete_site”,
“label”:“Enable on Complete Website”,
“default”: true
}
],
“presets”: [
{
“name”: “Breadcrumb Navigation”
}
]
}
{% endschema %}

If this does not do i might need access to your store as this should not be that tough and i know its achievable.
If this helps your cause please like and mark it as solution.

for any help or queries in future with shopify or any other platform for creating sites and landing pages or custom solutions like this.

Email ME

Buy me Coffee if this helps you. Would be motivating to continue providing solutions.

Thanks anyways

This didn’t work.

I will just make separate menu items. That has always given me the result I’m looking for. thanks for your help though!

@Boomdeleon will need access to your store to debug this since it worked fine for me when i did.

Let me know if its ok with you, you can send me collaborator code so i can send you the request

Thanks

@Boomdeleon Well if it works for you then what better than that.

Good luck on your store and business

FYI: Breadcrumbs to visited collections will only work if you have the current collection url prepended to the product link on your product cards.

@joshcorbett the code i have works like this where it adds the trails. Suppose you want to go to the product page and you go there directly from the home page then the breadcrumb will only show home and the product page.

Now suppose you go from home page to collections and then to a particular product page then breadcrumbs will show home collection and the product page you are on.

Hope you get the point.

So the all collections will only show if you go to the product page through all collections which will be the case most of the time. So what I am doing is on the product page I add a line of css to hide link with href= collections/all or just collections in some cases