Answers.Body: <p>I managed to workaround this by creating my own custom fieldtype which is 99% the code from the Craft CategoriesFieldType, but with the only difference being I removed the call to <code>craft()-&gt;categories-&gt;fillGapsInCategoryIds($categoryIds)</code>.</p>
  
  <p>This works but I've yet to see if it causes any side-effects I need to worry about.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-02T18:10:56.427Z
Answers.Text: FWIW, this is solved in the upcoming Craft 3 with the concept of category field branch limits.  Allows you to set how far up the category tree to select (if at all).
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-11T21:49:13.987Z
Answers.Text: James, would you mind throwing this modified field type on a public repo somewhere?
Answers.UserDisplayName: Chase Giunta
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-15T14:43:58.947Z
Answers.Text: @James, do you have the modified fieldtype you could post somewhere? Thanks.
Answers.UserDisplayName: Erik
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-02T11:16:07.993Z
Answers.LastActivityDate: 2017-10-02T18:07:33.307Z
Answers.LastEditDate: 2017-10-02T18:07:33.307Z
Answers.UserDisplayName: James
Body: <p>When adding a Categories field to a section, if you select only child categories, Craft automatically selects the parent categories too. I emailed Craft support about this and they explained it's by design and the workaround is to use a Structure instead of Categories.</p>
  
  <p>I'm unhappy with this as a workaround and was hoping their was another way to do this, either with a custom plugin or something else?</p>
  
  <p>Any help much appreciated</p>
  
  <p>Thanks! </p>
  
Tags: <categories><relations>
Title: Associate child categories only to an entry
ThreadText: # Associate child categories only to an entry
  
  (Asked by: username_0 on 2017-10-02)
  
  When adding a Categories field to a section, if you select only child categories, Craft automatically selects the parent categories too. I emailed Craft support about this and they explained it's by design and the workaround is to use a Structure instead of Categories.
  
  I'm unhappy with this as a workaround and was hoping their was another way to do this, either with a custom plugin or something else?
  
  Any help much appreciated
  
  Thanks!
  
  **Tags:** categories, relations
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2017-10-02. Score: 2 | Accepted answer
  
  I managed to workaround this by creating my own custom fieldtype which is 99% the code from the Craft CategoriesFieldType, but with the only difference being I removed the call to `craft()->categories->fillGapsInCategoryIds($categoryIds)`.
  
  This works but I've yet to see if it causes any side-effects I need to worry about.
  
  > **Comments:**
  > **username_1**: FWIW, this is solved in the upcoming Craft 3 with the concept of category field branch limits.  Allows you to set how far up the category tree to select (if at all).  
  > **username_2**: username_0, would you mind throwing this modified field type on a public repo somewhere?  
  > **username_3**: @username_0, do you have the modified fieldtype you could post somewhere? Thanks.  
  
  ---
  
  