Answers.Body: <p>If might be your wording but I can see two potential answers here.</p>
  
  <p>You either want to list categories set through a category field on the entry, in that case the code Douglas has supplied will work perfectly.</p>
  
  <p>The other answer I can see is you have multiple categories that are assigned to an entry, and you want to list those categories out. If so, this will help:</p>
  
  <pre><code>{# Fetch all of the categories related to this entry #}
  {% set categories = craft.categories.relatedTo(entry) %}
  
  {# Output them #}
  {% for category in categories %}
      &lt;a href="{{ category.url }}"&gt;{{ category.title }}&lt;/a&gt;
  {% endfor %}
  </code></pre>
  
  <p>Hopefully myself and Douglas have covered both bases for you here.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-26T19:58:10.467Z
Answers.Text: When trying this, I get no output, even when the entry has multiple categories set :-/
Answers.UserDisplayName: taylor
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-02T23:04:49.450Z
Answers.Text: Just for anyone seeing this 7 years later: `craft.categories().relatedTo(entry).all()` or `collect()` etc etc
Answers.UserDisplayName: Rob Hodges
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-26T09:32:15.807Z
Answers.LastActivityDate: 2015-01-26T09:32:15.807Z
Answers.UserDisplayName: Jamie Wade
Answers.Body: <p>Your entry is tied to the category via the field you have made. You can access the field like every other field. </p>
  
  <pre><code>entry.categoryFieldName.one()
  </code></pre>
  
  <p>Will get the first one</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-09T00:52:41.330Z
Answers.LastActivityDate: 2018-10-09T00:52:41.330Z
Answers.UserDisplayName: themartin
Answers.Body: <p>You can access the categories through the category field itself. </p>
  
  <pre><code>{% for category in entry.categoryFieldHandle %}
      {{ category.title }}
  {% endfor %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-26T19:57:35.537Z
Answers.Text: When trying this in _entry.html, I get an internal server error "Craft\EntryModel and its behaviors do not have a method or closure named "categoryFieldHandle"."
Answers.UserDisplayName: taylor
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-26T20:22:11.247Z
Answers.Text: 'categoryFieldHandle' is just a placeholder for your category field name (technically called it's 'handle'). You should replace this with your field handle as defined in the field settings.
Answers.UserDisplayName: Douglas McDonald
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-26T06:32:46.080Z
Answers.LastActivityDate: 2015-01-26T06:32:46.080Z
Answers.UserDisplayName: Douglas McDonald
Body: <p>For templating, I need to be able to see what the categories of the current entry is. I'm aware of how to get all categories in craft via</p>
  
  <pre><code>{% set categories = craft.categories %}
  </code></pre>
  
  <p>however I haven't come across a way to simple get the categories that are set for the entry. Is there a simple way of doing this?</p>
  
Tags: <templating><category>
Title: Get categories for current page/entry
ThreadText: # Get categories for current page/entry
  
  (Asked by: username_0 on 2015-01-26)
  
  For templating, I need to be able to see what the categories of the current entry is. I'm aware of how to get all categories in craft via
  
  ```
  {% set categories = craft.categories %}
  
  ```
  
  however I haven't come across a way to simple get the categories that are set for the entry. Is there a simple way of doing this?
  
  **Tags:** templating, category
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_4 on 2015-01-26. Score: 16 | Accepted answer
  
  You can access the categories through the category field itself.
  
  ```
  {% for category in entry.categoryFieldHandle %}
      {{ category.title }}
  {% endfor %}
  
  ```
  
  > **Comments:**
  > **username_0**: When trying this in _entry.html, I get an internal server error "Craft\EntryModel and its behaviors do not have a method or closure named "categoryFieldHandle"."  
  > **username_4**: 'categoryFieldHandle' is just a placeholder for your category field name (technically called it's 'handle'). You should replace this with your field handle as defined in the field settings.  
  
  ---
  
  ### Answer by username_1 on 2015-01-26. Score: 6
  
  If might be your wording but I can see two potential answers here.
  
  You either want to list categories set through a category field on the entry, in that case the code username_4 has supplied will work perfectly.
  
  The other answer I can see is you have multiple categories that are assigned to an entry, and you want to list those categories out. If so, this will help:
  
  ```
  {# Fetch all of the categories related to this entry #}
  {% set categories = craft.categories.relatedTo(entry) %}
  
  {# Output them #}
  {% for category in categories %}
      <a href="{{ category.url }}">{{ category.title }}</a>
  {% endfor %}
  
  ```
  
  Hopefully myself and username_4 have covered both bases for you here.
  
  > **Comments:**
  > **username_0**: When trying this, I get no output, even when the entry has multiple categories set :-/  
  > **username_2**: Just for anyone seeing this 7 years later: `craft.categories().relatedTo(entry).all()` or `collect()` etc etc  
  
  ---
  
  ### Answer by username_3 on 2018-10-09. Score: 1
  
  Your entry is tied to the category via the field you have made. You can access the field like every other field.
  
  ```
  entry.categoryFieldName.one()
  
  ```
  
  Will get the first one
  
  
  ---
  
  