<p>You could use a structure for Genre rather than categories. This would let you select <em>Thrillers</em> as a single entry.</p>

CC BY-SA 3.0
2016-03-08T21:43:03.553Z
As it happens, I've changed my thinking on this, so I'm allowing unlimited categories to be selected, but using an 'and' relation. For example, they could select humour and crime and advertise it as "Crime Capers".

That said, I think to do what I originally asked, a structure may well be the only way, so I'll accept this as the answer - thanks!
Jammooka
CC BY-SA 3.0
2016-03-08T07:01:43.210Z
2016-03-08T07:01:43.210Z
Marion Newlevant
<p>I have a section of book entries with a categories field called "Genre". A book can fall into multiple genres. A stripped down version of the categories works something like this:</p>

<ul>
<li>Fiction

<ul>
<li>Crime, Thrillers &amp; Mystery

<ul>
<li>Mystery</li>
<li>Thrillers</li>
<li>Action &amp; Adventure</li>
</ul></li>
<li>Fantasy</li>
</ul></li>
<li>Non-Fiction

<ul>
<li>etc</li>
</ul></li>
</ul>

<p>On the home page, there is to be a feature panel linking to a particular genre, let's say <em>Thrillers</em> for example.</p>

<p>For the feature panel field, I need to limit this to a single genre, but if I set the limit on the categories field to 1 and select <em>Thrillers</em>, it just selects <em>Fiction</em>.</p>

<p>Of course I could just remove the limit and then use twig to get only entries from the deepest selected category, but I don't want to open up the possibility that they'll select multiple categories.</p>

<p>Is there any way around this? I can't help but feel like the limit option on the categories fieldtype is a bit broken.</p>

<p><strong>* Update for clarity *</strong></p>

<p>Categories group called Genre is structured as above<br>
Books channel has a category field called Genre, allowed to select multiple genres<br>
Homepage has a category field called Related Genre</p>

<p>The intention is to choose a single category for Related Genre to output the books which have that category selected in Genre.</p>

<p>This is all entirely within the admin area, so code is effectively irrelevant at this point.</p>

<p>Perhaps some images will make this clearer:</p>

<p>In the entry, I attempt to select Thrillers:<br>
<a href="https://i.sstatic.net/G2Pa2.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/G2Pa2.png" alt="Attempt to select Thrillers"></a></p>

<p>But after clicking select, it has just selected Fiction:<br>
<a href="https://i.sstatic.net/dtJeP.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/dtJeP.png" alt="Selected fiction instead"></a></p>

CC BY-SA 3.0
2016-03-07T19:11:56.653Z
I don't entirely understand your question. You are providing a checkbox to allow them to select a single category on the front-end? Please elaborate a bit more and include your code as well.
Christopher Healey
CC BY-SA 3.0
2016-03-07T20:33:53.203Z
Hi Christopher, thanks for replying. There is no code to speak of as this is an issue within the admin itself - please see updated answer for some more details.The docs state that the limit includes parent categories, so I'm not sure if anything can be done, but this seems like a logical approach to me, so seems odd that I can't do it.
Jammooka
CC BY-SA 3.0
2016-03-08T02:34:11.850Z
This is a issue that I'm looking to answer as well. When selecting a child category, the parent category appears as the selected item in the entry. http://craftcms.stackexchange.com/questions/14043/child-categories-appear-as-their-parent-when-selected
Zach Shallbetter
<categories><limit>
Limit category choice in entry to 1 and select child category
# Limit category choice in entry to 1 and select child category

(Asked by: username_0 on 2016-03-07)

I have a section of book entries with a categories field called "Genre". A book can fall into multiple genres. A stripped down version of the categories works something like this:

* Fiction
  + Crime, Thrillers & Mystery
    - Mystery
    - Thrillers
    - Action & Adventure
  + Fantasy
* Non-Fiction
  + etc

On the home page, there is to be a feature panel linking to a particular genre, let's say *Thrillers* for example.

For the feature panel field, I need to limit this to a single genre, but if I set the limit on the categories field to 1 and select *Thrillers*, it just selects *Fiction*.

Of course I could just remove the limit and then use twig to get only entries from the deepest selected category, but I don't want to open up the possibility that they'll select multiple categories.

Is there any way around this? I can't help but feel like the limit option on the categories fieldtype is a bit broken.

**\* Update for clarity \***

Categories group called Genre is structured as above  
Books channel has a category field called Genre, allowed to select multiple genres  
Homepage has a category field called Related Genre

The intention is to choose a single category for Related Genre to output the books which have that category selected in Genre.

This is all entirely within the admin area, so code is effectively irrelevant at this point.

Perhaps some images will make this clearer:

In the entry, I attempt to select Thrillers:  
[![Attempt to select Thrillers](https://i.sstatic.net/G2Pa2.png)](https://i.sstatic.net/G2Pa2.png)

But after clicking select, it has just selected Fiction:  
[![Selected fiction instead](https://i.sstatic.net/dtJeP.png)](https://i.sstatic.net/dtJeP.png)

**Tags:** categories, limit

> **Comments:**
> **username_1**: I don't entirely understand your question. You are providing a checkbox to allow them to select a single category on the front-end? Please elaborate a bit more and include your code as well.  
> **username_0**: Hi Christopher, thanks for replying. There is no code to speak of as this is an issue within the admin itself - please see updated answer for some more details.The docs state that the limit includes parent categories, so I'm not sure if anything can be done, but this seems like a logical approach to me, so seems odd that I can't do it.  
> **username_2**: This is a issue that I'm looking to answer as well. When selecting a child category, the parent category appears as the selected item in the entry. http://craftcms.stackexchange.com/questions/14043/child-categories-appear-as-their-parent-when-selected  

---

## 1 answers

### Answer by username_3 on 2016-03-08. Score: 1 | Accepted answer

You could use a structure for Genre rather than categories. This would let you select *Thrillers* as a single entry.

> **Comments:**
> **username_0**: As it happens, I've changed my thinking on this, so I'm allowing unlimited categories to be selected, but using an 'and' relation. For example, they could select humour and crime and advertise it as "Crime Capers".  That said, I think to do what I originally asked, a structure may well be the only way, so I'll accept this as the answer - thanks!  

---

