Skip to content
This repository has been archived by the owner on Aug 30, 2018. It is now read-only.

Updated blog sidebar to show all tags all the time #120

Merged
merged 3 commits into from
Jun 18, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions snippets/blog-sidebar.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
{% comment %}
Blog tags
{% endcomment %}
{% if blog.tags.size > 0 %}
{% if blog.all_tags.size > 0 %}
<h4>Categories</h4>
<ul>
{% for tag in blog.tags %}
{% for tag in blog.all_tags %}
{% if current_tags contains tag %}
<li>{{ tag }}</li>
{% else %}
Expand Down
32 changes: 21 additions & 11 deletions snippets/breadcrumb.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,61 @@
Documentation - http://docs.shopify.com/support/your-website/navigation/creating-a-breadcrumb-navigation
{% endcomment %}
{% unless template == 'index' or template == 'cart' %}
<div class="breadcrumb">
<nav class="breadcrumb" role="navigation" aria-label="breadcrumbs">
<a href="/" title="Back to the frontpage">Home</a>

{% if template contains 'product' %}

{% if collection %}
<span>&rsaquo;</span>
<span aria-hidden="true">&rsaquo;</span>
{% if collection.handle %}
{% capture url %}/collections/{{ collection.handle }}{% endcapture %}
{{ collection.title | link_to: url }}
{% endif %}
{% endif %}
<span>&rsaquo;</span>
<span aria-hidden="true">&rsaquo;</span>
<span>{{ product.title }}</span>

{% elsif template contains 'collection' and collection.handle %}

<span aria-hidden="true">&rsaquo;</span>
{% if current_tags %}
<span>&rsaquo;</span>
{% capture url %}/collections/{{ collection.handle }}{% endcapture %}
{{ collection.title | link_to: url }}
<span>&rsaquo;</span>
<span aria-hidden="true">&rsaquo;</span>
<span>{{ current_tags | join: " + " }}</span>
{% else %}
<span>&rsaquo;</span>
<span>{{ collection.title }}</span>
{% endif %}

{% elsif template == 'blog' %}

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

{% elsif template == 'article' %}

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

{% elsif template contains 'page' %}

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

{% else %}

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

{% endif %}
</div>
</nav>
{% endunless %}
18 changes: 5 additions & 13 deletions snippets/collection-sidebar.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,9 @@
- List all of the shop's types with collections.all.all_types
- List the current collection's types with collection.all_types
{% endcomment %}
<h3>Product Types</h3>
{% if collection.all_types.size > 0 %}
<h3>Product Types</h3>
<ul>
{% comment %}
And for the good stuff, loop through the tags themselves.
{% endcomment %}
{% for type in collection.all_types %}
{% if collection.current_type == type %}
<li class="active-filter">
Expand All @@ -50,13 +47,9 @@
- List all of the shop's vendors with collections.all.all_vendors
- List the current collection's vendors with collection.all_vendors
{% endcomment %}
<h3>Vendors</h3>
{% if collection.all_vendors.size > 0 %}

<h3>Vendors</h3>
<ul>
{% comment %}
And for the good stuff, loop through the tags themselves.
{% endcomment %}
{% for vendor in collection.all_vendors %}
{% if collection.current_vendor == vendor %}
<li class="active-filter">
Expand All @@ -77,14 +70,13 @@
{% comment %}
Product tags in the current collection
{% endcomment %}
<h3>Tags</h3>
{% if collection.all_tags.size > 0 %}
<h3>Tags</h3>

{% comment %}
Say we want to provide a 'catch-all' link at the top of the list,
we'd check against the collection.handle, product type, and vendor.
To provide a 'catch-all' link at the top of the list,
check against the collection.handle, product type, and vendor.
{% endcomment %}

<ul>
<li{% unless current_tags %} class="active-filter"{% endunless %}>

Expand Down