Answers.Body: <p>Try changing this:</p>
  
  <pre><code>{% set category = craft.categories.slug(slug) %}
  </code></pre>
  
  <p>to</p>
  
  <pre><code>{% set category = craft.categories.slug(slug).first() %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-17T19:06:41.973Z
Answers.Text: Brad, you nailed it. I still don't understand why you have to explicitly mention `.first()` since there is only one object that is returned.
Answers.UserDisplayName: hvs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-17T20:42:52.587Z
Answers.Text: Slugs are not unique, ids are, so there is a chance you could have more than one category being returned. Don't quote me on that, but just remember to use first()
Answers.UserDisplayName: Brad
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-17T18:45:58.613Z
Answers.LastActivityDate: 2017-04-17T18:45:58.613Z
Answers.UserDisplayName: Brad
Body: <pre><code>{% set slug = craft.request.getParam('s') %}
  
  {% if slug | length %}
      {% set category = craft.categories.slug(slug) %}
      {% set faqs = craft.entries.section('faq').order('title').limit(null) %}
  
      &lt;h3&gt;{{ category.title }}&lt;/h3&gt;
  
      &lt;ul class="no-bullet"&gt;
          {% for entry in faqs.relatedTo(category) %}
              {% if entry.level &gt;1 %} 
                  &lt;li&gt;&lt;a href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;&lt;/li&gt;
              {% endif %}  
          {% endfor %}
      &lt;/ul&gt;
  {% else %}
      &lt;h3&gt; No matching results found &lt;/h3&gt;
  {% endif %} 
  </code></pre>
  
  <p>In the code above, I cannot get <code>{{ category.title }}</code> to display. It is empty. If I put <code>{{ category.slug }}</code> instead, it shows the correct value. The other items in unordered list are displaying perfectly. I am confused as to why the title is not showing    </p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-04-17T18:44:54.760Z
Comments.Text: If you simplify it to `{% set slug = craft.request.getParam('s') %}{% set category = craft.categories.slug(slug) %}{{ category.title }}` does it work?  Is this a multi-locale setup?
Comments.UserDisplayName: Brad Bell
Tags: <entries><category>
Title: Cannot get category.title to show up
ThreadText: # Cannot get category.title to show up
  
  (Asked by: username_0 on 2017-04-17)
  
  ```
  {% set slug = craft.request.getParam('s') %}
  
  {% if slug | length %}
      {% set category = craft.categories.slug(slug) %}
      {% set faqs = craft.entries.section('faq').order('title').limit(null) %}
  
      <h3>{{ category.title }}</h3>
  
      <ul class="no-bullet">
          {% for entry in faqs.relatedTo(category) %}
              {% if entry.level >1 %} 
                  <li><a href="{{ entry.url }}">{{ entry.title }}</a></li>
              {% endif %}  
          {% endfor %}
      </ul>
  {% else %}
      <h3> No matching results found </h3>
  {% endif %} 
  
  ```
  
  In the code above, I cannot get `{{ category.title }}` to display. It is empty. If I put `{{ category.slug }}` instead, it shows the correct value. The other items in unordered list are displaying perfectly. I am confused as to why the title is not showing
  
  **Tags:** entries, category
  
  > **Comments:**
  > **username_1**: If you simplify it to `{% set slug = craft.request.getParam('s') %}{% set category = craft.categories.slug(slug) %}{{ category.title }}` does it work?  Is this a multi-locale setup?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2017-04-17. Score: 1 | Accepted answer
  
  Try changing this:
  
  ```
  {% set category = craft.categories.slug(slug) %}
  
  ```
  
  to
  
  ```
  {% set category = craft.categories.slug(slug).first() %}
  
  ```
  
  > **Comments:**
  > **username_0**: username_1, you nailed it. I still don't understand why you have to explicitly mention `.first()` since there is only one object that is returned.  
  > **username_2**: Slugs are not unique, ids are, so there is a chance you could have more than one category being returned. Don't quote me on that, but just remember to use first()  
  
  ---
  
  