I'm a Craft first-timer building a simple blog site. I want to include breadcrumbs at the top of each page like so:
siteurl.com: [Blog]
siteurl.com/category/example-category: [Blog > Example Category]
siteurl.com/post/2015/entry-title: [Blog > Entry Title]
I've found this snippet which correctly outputs the breadcrumb for the entry permalink page:
<ul class="breadcrumbs">
<li><a href="{{ siteUrl }}">Blog</a></li>
{% if craft.request.segments %}
{% for crumb in entry.getAncestors() %}
<li>{{ crumb.getLink() }}</li>
{% endfor %}
<li>{{ entry.title() }}</a></li>
{% endif %}
</ul>
But I also need something that will include a crumb for when the visitor is on a category page.
So far, my templates are structured like so:
templates/
| index.html
| _layout.html
| posts/
| index.html
| category.html
| _entry.html
Where the breadcrumb snippet is included in '_layout.html'.
In EE, I would just check my segments and use Low Seg2Cat to grab the category title. Is there an equivalent to this process in Craft? Or is it handled completely differently?