Supply theme to show Home > Page > Collection > Product

Tourist
15 0 0

Hi. This is the code for the supply theme breadcrumbs. How can I add in the page before collection? The Breadcrumbs should go Home > Page > Collection > Product.    Thanks.

 

{% include 'advanced-tag-loop' %}

{% unless template.name == 'index' or template.name == 'cart' %}
<nav class="breadcrumb" role="navigation" aria-label="breadcrumbs">
  <a href="/" title="{{ 'general.breadcrumbs.home_link_title' | t }}">{{ 'general.breadcrumbs.home' | t }}</a>
  
  {% if template.name == 'product' %}  
  
    {% if collection %}
      <span class="divider" aria-hidden="true">&rsaquo;</span>
      {% if collection.handle %}
        {% capture url %}/collections/{{ collection.handle }}{% endcapture %}
        {{ collection.title | link_to: url }}
      {% endif %}
    {% endif %}
    <span class="divider" aria-hidden="true">&rsaquo;</span>
    <span class="breadcrumb--truncate">{{ product.title }}</span>

  {% elsif template.name == 'collection' and collection.handle %}

    <span class="divider" aria-hidden="true">&rsaquo;</span>

    {% if current_tags %}
  
      {% capture url %}/collections/{{ collection.handle }}{% endcapture %}
      {{ collection.title | link_to: url }}

      <span class="divider" aria-hidden="true">&rsaquo;</span>

      {% for tag in current_tags %}

        {% assign is_advanced_tag = false %}
        {% assign cat = tag | split: '_' | first %}
        {% unless cat == tag %}
          {% if cat_array contains cat %}
            {% assign is_advanced_tag = true %}
            <span>
              {{ tag | remove_first: cat | remove_first: '_' }}
            </span>
          {% endif %}
        {% endunless %}

        {% if is_advanced_tag == false %}
        <span>
          {{ tag }}
        </span>
        {% endif %}

        {% unless forloop.last %}
        <span>+</span>
        {% endunless %}

      {% endfor %}

    {% else %}
      <span>{{ collection.title }}</span>
    {% endif %}

  {% elsif template.name == 'blog' %}

    <span class="divider" aria-hidden="true">&rsaquo;</span>
    {% if current_tags %}
      {{ blog.title | link_to: blog.url }}
      <span class="divider" aria-hidden="true">&rsaquo;</span>
      <span>{{ current_tags | join: " + " }}</span>
    {% else %}
    <span>{{ blog.title }}</span>
    {% endif %}

  {% elsif template.name == 'article' %}

    <span class="divider" aria-hidden="true">&rsaquo;</span>
    {{ blog.title | link_to: blog.url }}
    <span class="divider" aria-hidden="true">&rsaquo;</span>
    <span>{{ article.title }}</span>

  {% elsif template.name == 'page' %}

    <span class="divider" aria-hidden="true">&rsaquo;</span>
   <span>{{ page.title }}</span>

  {% else %}

    <span class="divider" aria-hidden="true">&rsaquo;</span>
   <span>{{ page_title }}</span>

  {% endif %}
</nav>
{% endunless %}
0 Likes
Shopify Staff
Shopify Staff
178 28 22

Hello, @AsiaSell.

 

Elias here with Shopify Support. Thank you for reaching out.

 

If you’re store is using a Shopify theme and subscribed to a plan, adjusting the breadcrumbs is supported as part of our design policy. However, I have confirmed with our Theme Support team that the breadcrumbs structure will not work with pages. The breadcrumbs structure that our system supports would be either:

 

‘Home > Collections > Products’ 

Or

‘Home > Page’

 

I understand your store uses pages to showcase your collections and this is something you would like to have for your store. I will be sharing this feedback as a feature request with our developers, regarding collections created in pages to be included in the breadcrumbs structure, so that it can be considered for future releases of our platform. If Shopify moves forward with this feature, you can find it in our changelog or announcements page.

 

If you have any other questions regarding the breadcrumbs, feel free to let me know in this thread.

Elias | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes
Tourist
15 0 0

Ok Thanks. In addition I think my sitemap has been messed up or not updated after I put the collections into pages. Might have to go back to having all collections on the homepage.

0 Likes