Answers.Body: <p>Not with the out-of-the-box field types. You could create a field type that is category+default. The <a href="https://github.com/marionnewlevant/craft-defaultcolor">Default Color</a> plugin might be a good place to start.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-31T17:17:55.547Z
Answers.LastActivityDate: 2014-07-31T17:17:55.547Z
Answers.UserDisplayName: Marion Newlevant
Answers.Body: <p>You could output the categories in a way that makes them look like they are from a specific category when they don't have any categories assigned to them.</p>
  
  <p>When you're outputting any of the entries, just add a custom link if there isn't a category assigned:</p>
  
  
  
  <pre class="lang-twig prettyprint-override"><code>{% if entry.categories|length %}
      {% for category in entry.categories %}
          &lt;a href="/blog/category/{{ category.url }}"&gt;{{ category.title }}&lt;/a&gt;
      {% endfor %}
  {% else %}
      &lt;a href="/blog/category/default-category-slug"&gt;Default Category Title&lt;/a&gt;
  {% endif %}
  </code></pre>
  
  <p>Create a route that points "/blog/category/default-category-slug" to your filtered listing template (/blog/index, /blog/category etc.).</p>
  
  <p>On the filtered listing template check if the default category slug is in the URL:</p>
  
  <pre class="lang-twig prettyprint-override"><code>{% if craft.request.getSegment(3) == 'default-category-slug' %}
  </code></pre>
  
  <p>If that evaluates to true, you can now get the entries without any categories assigned to them and loop through them, see this question: <a href="https://craftcms.stackexchange.com/questions/603/how-to-find-entries-with-no-category">How to find entries with no category</a>:</p>
  
  <pre class="lang-twig prettyprint-override"><code>{% set uncategorized = craft.entries.section('blog').search('-categories:*') %}
  {% for entry in uncategorized %}
      {# show entry #}
  {% endfor %}
  </code></pre>
  
  <hr>
  
  <p>Any other times you need to get the entries that "have" the default category, to loop through them, use <a href="http://buildwithcraft.com/docs/relations" rel="nofollow noreferrer"><code>.relatedTo</code></a> on etc., instead of using:</p>
  
  <pre class="lang-twig prettyprint-override"><code>{% set entriesWithDefaultCategory = craft.entries.section('blog').relatedTo('the-default-category') %}
  </code></pre>
  
  <p>Use this like on the filtered listing above:</p>
  
  <pre class="lang-twig prettyprint-override"><code>{% set uncategorized = craft.entries.section('blog').search('-categories:*') %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-31T20:00:16.433Z
Answers.LastActivityDate: 2014-07-31T20:00:16.433Z
Answers.LastEditDate: 2017-04-13T12:50:59.930Z
Answers.UserDisplayName: Simon Kuran
Body: <p>I've set up a channel using categories to distinguish between different blog post types. The majority will probably be in one category, so it would be great to be able to specify a default category. However, as far as I can see the Category field type (unlike, say, the Drop Down field type) doesn't give you the option to set a default... Is there any way of doing this?</p>
  
Tags: <templating><categories><field>
Title: Is there any way of specifying a default category for a category field?
ThreadText: # Is there any way of specifying a default category for a category field?
  
  (Asked by: username_0 on 2014-07-30)
  
  I've set up a channel using categories to distinguish between different blog post types. The majority will probably be in one category, so it would be great to be able to specify a default category. However, as far as I can see the Category field type (unlike, say, the Drop Down field type) doesn't give you the option to set a default... Is there any way of doing this?
  
  **Tags:** templating, categories, field
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2014-07-31. Score: 6 | Accepted answer
  
  You could output the categories in a way that makes them look like they are from a specific category when they don't have any categories assigned to them.
  
  When you're outputting any of the entries, just add a custom link if there isn't a category assigned:
  
  ```twig
  {% if entry.categories|length %}
      {% for category in entry.categories %}
          <a href="/blog/category/{{ category.url }}">{{ category.title }}</a>
      {% endfor %}
  {% else %}
      <a href="/blog/category/default-category-slug">Default Category Title</a>
  {% endif %}
  
  ```
  
  Create a route that points "/blog/category/default-category-slug" to your filtered listing template (/blog/index, /blog/category etc.).
  
  On the filtered listing template check if the default category slug is in the URL:
  
  ```twig
  {% if craft.request.getSegment(3) == 'default-category-slug' %}
  
  ```
  
  If that evaluates to true, you can now get the entries without any categories assigned to them and loop through them, see this question: [How to find entries with no category](https://craftcms.stackexchange.com/questions/603/how-to-find-entries-with-no-category):
  
  ```twig
  {% set uncategorized = craft.entries.section('blog').search('-categories:*') %}
  {% for entry in uncategorized %}
      {# show entry #}
  {% endfor %}
  
  ```
  
  ---
  
  Any other times you need to get the entries that "have" the default category, to loop through them, use [`.relatedTo`](http://buildwithcraft.com/docs/relations) on etc., instead of using:
  
  ```twig
  {% set entriesWithDefaultCategory = craft.entries.section('blog').relatedTo('the-default-category') %}
  
  ```
  
  Use this like on the filtered listing above:
  
  ```twig
  {% set uncategorized = craft.entries.section('blog').search('-categories:*') %}
  
  ```
  
  
  ---
  
  ### Answer by username_1 on 2014-07-31. Score: 5
  
  Not with the out-of-the-box field types. You could create a field type that is category+default. The [Default Color](https://github.com/username_1/craft-defaultcolor) plugin might be a good place to start.
  
  
  ---
  
  