Body: <p>I have 4 level product categories. For the menu I am building I need to pick a second category in all top level categories</p>
  <p>So I get top level categories like so</p>
  <pre><code>{% set lv1Categories  = craft.categories.group('products').level(1) %}
  </code></pre>
  <p>How do I then get a second in the returned list?</p>
  <pre><code>{% set cat = lv1Categories[1] %}
  </code></pre>
  <p>This doesn't seem to work</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-15T19:47:37.117Z
Comments.Text: Hey, what do you expect `lv1Categories[1]` to do? Do you want a 2nd level subcategory?
Comments.UserDisplayName: Johannes
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-15T19:52:03.280Z
Comments.Text: Might help to post a screen cap of your category structure?
Comments.UserDisplayName: RitterKnight
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-15T20:26:25.070Z
Comments.Text: @Johannes There are two top level categories 'Recipients' and 'Departments'. 
  
  I would expect lv1Categories[1] to reference 'Departments', so I can iterate over it's children with 
  
  {% for categoryLv2 in categoryLv1.getChildren() %}
Comments.UserDisplayName: Lumiere
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-18T08:36:50.550Z
Comments.Text: If that's your actual markup, then the first line is missing a `.all()` - without it, you have a CategoryQuery object rather than an iterable set of results.
Comments.UserDisplayName: Martin Spain
Tags: <categories><craft2>
Title: How to get a specific category by index
ThreadText: # How to get a specific category by index
  
  (Asked by: username_0 on 2021-01-15)
  
  I have 4 level product categories. For the menu I am building I need to pick a second category in all top level categories
  
  So I get top level categories like so
  
  ```
  {% set lv1Categories  = craft.categories.group('products').level(1) %}
  
  ```
  
  How do I then get a second in the returned list?
  
  ```
  {% set cat = lv1Categories[1] %}
  
  ```
  
  This doesn't seem to work
  
  **Tags:** categories, craft2
  
  > **Comments:**
  > **username_1**: Hey, what do you expect `lv1Categories[1]` to do? Do you want a 2nd level subcategory?  
  > **username_2**: Might help to post a screen cap of your category structure?  
  > **username_0**: @username_1 There are two top level categories 'Recipients' and 'Departments'.   I would expect lv1Categories[1] to reference 'Departments', so I can iterate over it's children with   {% for categoryLv2 in categoryLv1.getChildren() %}  
  > **username_3**: If that's your actual markup, then the first line is missing a `.all()` - without it, you have a CategoryQuery object rather than an iterable set of results.  
  
  ---
  
  ## 0 answers
  
  