Answers.Body: <p>I've managed to solve it. <code>&lt;span class='nav-item'&gt;&lt;a href="{{ category.counties.first().url }}"&gt;{{ category.counties.first().title }}&lt;/a&gt;&lt;/span&gt;</code> did the trick.</p>
  
  <p>Clearly I just needed to print the category field, although I'm not sure why it needs the <code>.first()</code> after <code>category.counties</code> to print it? But it works at least after days of struggling to find an answer.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-14T22:50:22.923Z
Answers.LastActivityDate: 2016-12-14T22:50:22.923Z
Answers.UserDisplayName: mention79
Body: <p>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 <code>category.title</code>, but I need to display the correct category for the previous breadcrumb also.</p>
  
  <p>I've made some progress and have managed to get it to display the first category in the group I want by using <code>{% set county = craft.categories.group('counties').first() %}</code> 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.</p>
  
  <p>Here's the current code:</p>
  
  <pre><code>{% block breadcrumbs %}
      &lt;div class="full-width breadcrumbs nav-breadcrumbs navbar-fixed-top"&gt;
          &lt;div class='container'&gt;
              &lt;header class='scroll'&gt;
                  &lt;span class='nav-item'&gt;&lt;a href="/"&gt;&lt;i class="icon-home"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/span&gt;
                  &lt;span class='nav-item'&gt;&lt;a href="/developments"&gt;All Developments&lt;/a&gt;&lt;/span&gt;
                  {% set county = craft.categories.group('counties').first() %}
                  &lt;span class='nav-item'&gt;&lt;a href="{{ county.url }}"&gt;{{ county.title }}&lt;/a&gt;&lt;/span&gt;
                  &lt;span class='nav-item active'&gt;&lt;a href="{{ category.url }}"&gt;{{ category.title }}&lt;/a&gt;&lt;/span&gt;
              &lt;/header&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  {% endblock %}
  </code></pre>
  
Tags: <categories>
Title: Display different Categories groups in custom breadcrumbs
ThreadText: # Display different Categories groups in custom breadcrumbs
  
  (Asked by: username_0 on 2016-12-13)
  
  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 %}
  
  ```
  
  **Tags:** categories
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2016-12-14. Score: 2
  
  I've managed to solve it. `<span class='nav-item'><a href="{{ category.counties.first().url }}">{{ category.counties.first().title }}</a></span>` did the trick.
  
  Clearly I just needed to print the category field, although I'm not sure why it needs the `.first()` after `category.counties` to print it? But it works at least after days of struggling to find an answer.
  
  
  ---
  
  