Answers.Body: <p>Loop through the categories of the entry, add and if it's not the last loop index, like so:</p>
  
  <pre><code>{% for category in  entry.categoryFieldHandle %}
   {{category.title}} {{ loop.last ? '': 'and '}}
  {% endfor %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-07T17:53:38.347Z
Answers.LastActivityDate: 2017-02-07T17:53:38.347Z
Answers.UserDisplayName: Jan_dh
Answers.Body: <p>The accepted answer will work, certainly, but thanks to the way Craft works behind the scenes there is a more compact and elegant solution:</p>
  
  <pre><code>{{ entry.categoryFieldHandle|join(' and ') }}
  </code></pre>
  
  <h2>Why this works</h2>
  
  <p>The Entry's category field (accessed via <code>entry.categoryFieldHandle</code>) returns an <a href="https://craftcms.com/classreference/models/ElementCriteriaModel" rel="nofollow noreferrer">ElementCriteriaModel</a>, which implements <a href="http://php.net/manual/en/class.arrayaccess.php" rel="nofollow noreferrer">PHP's ArrayAccess interface</a>.</p>
  
  <p>In plain English, this means that we can treat the ElementCriteriaModel as an array.</p>
  
  <p>The ElementCriteriaModel returns a collection of <a href="https://craftcms.com/classreference/models/CategoryModel" rel="nofollow noreferrer">CategoryModel</a> objects, each of which implements <a href="http://php.net/manual/en/language.oop5.magic.php#object.tostring" rel="nofollow noreferrer">a <code>__toString</code> method</a> (returning the Category title). This effectively means we can treat the object as a string.</p>
  
  <p>The above features mean that we can pass our ElementCriteriaModel directly to <a href="http://twig.sensiolabs.org/doc/1.x/filters/join.html" rel="nofollow noreferrer">the Twig <code>join</code> filter</a>, and it will concatenate the Category titles using the "glue" string " and ".</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-08T17:22:01.180Z
Answers.LastActivityDate: 2017-02-08T17:22:01.180Z
Answers.UserDisplayName: Stephen Lewis
Body: <p>I have some entries that have more than one category assigned to them (under the same category group).  For example, Entry X might be assigned to Category A and Category D.   How do I get it to print <code>"Category A **and** Category B"</code> instead of <code>Category A Category B"</code>?</p>
  
Tags: <templating>
Title: How can I add "and" between multiple categories assigned to an entry?
ThreadText: # How can I add "and" between multiple categories assigned to an entry?
  
  (Asked by: username_0 on 2017-02-07)
  
  I have some entries that have more than one category assigned to them (under the same category group). For example, Entry X might be assigned to Category A and Category D. How do I get it to print `"Category A **and** Category B"` instead of `Category A Category B"`?
  
  **Tags:** templating
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2017-02-07. Score: 3 | Accepted answer
  
  Loop through the categories of the entry, add and if it's not the last loop index, like so:
  
  ```
  {% for category in  entry.categoryFieldHandle %}
   {{category.title}} {{ loop.last ? '': 'and '}}
  {% endfor %}
  
  ```
  
  
  ---
  
  ### Answer by username_2 on 2017-02-08. Score: 2
  
  The accepted answer will work, certainly, but thanks to the way Craft works behind the scenes there is a more compact and elegant solution:
  
  ```
  {{ entry.categoryFieldHandle|join(' and ') }}
  
  ```
  
  ## Why this works
  
  The Entry's category field (accessed via `entry.categoryFieldHandle`) returns an [ElementCriteriaModel](https://craftcms.com/classreference/models/ElementCriteriaModel), which implements [PHP's ArrayAccess interface](http://php.net/manual/en/class.arrayaccess.php).
  
  In plain English, this means that we can treat the ElementCriteriaModel as an array.
  
  The ElementCriteriaModel returns a collection of [CategoryModel](https://craftcms.com/classreference/models/CategoryModel) objects, each of which implements [a `__toString` method](http://php.net/manual/en/language.oop5.magic.php#object.tostring) (returning the Category title). This effectively means we can treat the object as a string.
  
  The above features mean that we can pass our ElementCriteriaModel directly to [the Twig `join` filter](http://twig.sensiolabs.org/doc/1.x/filters/join.html), and it will concatenate the Category titles using the "glue" string " and ".
  
  
  ---
  
  