Make breadcrumbs more specific and reposition them

GregWithProEdge
New Member
6 0 0

As of now my breadcrumbs for my company's website (Pro-Edge.com) are only showing for the collection or category, I would like for the breadcrumbs to show from home to category to the collection users are on so they aren't confused as to which category they're in while they shop (ex: we have hinges for both residential and commercial but the breadcrumbs will just say "home>hinges" so users will not understand which locksets they're in, I would like for it to say "home>commercial>hinges" or "home>residential>hinges). I would also like to line up the breadcrumbs so they align with the categories listed at the top. I have attached an image to illustrate these issues.

.Screenshot 2021-02-15 084743.png 

Here is my breadcrumbs.liquid code below. Anything that works I will accept as a solution thank you for your help!

 

{% 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