I have a custom list of breadcrumbs that two of the levels reference different Category Groups. I'm able to get the correct breadcrumb to display for the page that I'm on using category.title
, but I need to display the correct category for the previous breadcrumb also.
I've made some progress and have managed to get it to display the first category in the group I want by using {% set county = craft.categories.group('counties').first() %}
but I need it to display the category that I've attached to the page with a category field, and not just the first item in the category.
Here's the current code:
{% block breadcrumbs %}
<div class="full-width breadcrumbs nav-breadcrumbs navbar-fixed-top">
<div class='container'>
<header class='scroll'>
<span class='nav-item'><a href="/"><i class="icon-home"></i></a></span>
<span class='nav-item'><a href="/developments">All Developments</a></span>
{% set county = craft.categories.group('counties').first() %}
<span class='nav-item'><a href="{{ county.url }}">{{ county.title }}</a></span>
<span class='nav-item active'><a href="{{ category.url }}">{{ category.title }}</a></span>
</header>
</div>
</div>
{% endblock %}