Answers.Body: <p>Okey, I already solved it by investigating more.</p>
  <p>I made it work with this code:</p>
  <pre><code>{% for item in entry.menusItems %}
          
              &lt;li class=&quot;grid-item__li&quot;&gt;
  
                  &lt;div class=&quot;grid-item__category&quot;&gt;
  
                          {% for category in item.menucategory %}
  
                              &lt;label class=&quot;item__category--label&quot;&gt;{{ category.title }}&lt;/label&gt;
  
                          {% endfor %}
                          
                  &lt;/div&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-03-16T20:14:52.047Z
Answers.Text: Yes! This outputs each menu item, and for each item outputs the categories that are attached to it via the menucategory field on the item. Do note that this will output a category label for every category, if more than one category is selected in that field. Nice job, and don't forget you can mark your own answer as "the accepted answer" to close this out :)
Answers.UserDisplayName: cherrykoda
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-03-16T19:03:45.503Z
Answers.LastActivityDate: 2023-03-16T19:03:45.503Z
Answers.UserDisplayName: mencantalamelva
Body: <p>I have a single page(index) where I'm showing all my items.</p>
  <p><a href="https://i.sstatic.net/0j9UW.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/0j9UW.png" alt="enter image description here" /></a></p>
  <p>I have the field for setting the category on my item's section so that when I'm on the item page it shows the category of the post.</p>
  <p><a href="https://i.sstatic.net/vshUI.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/vshUI.png" alt="enter image description here" /></a></p>
  <p>The thing is that I want to show the category of the child (item) on the index page and I'm having troubles as I don't know how to access the category from it from the page before to it.
  I mean, on the index page on &quot;Menú barbacoa&quot; I want that it displays on the yellow container it's category, that is &quot;Menu estrella&quot;</p>
  <p>For showing the items on the index page, I have a for loop looking like this:</p>
  <pre><code>{% for item in entry.menusItems %}
          
              &lt;li class=&quot;grid-item__li&quot;&gt;
  
                  &lt;div class=&quot;grid-item__category&quot;&gt;
  
                      {% set category = craft.categories.group('menus') %}
                      &lt;label class=&quot;item__category--label&quot;&gt;{{ category.title }}&lt;/label&gt;
  
                  &lt;/div&gt;
  </code></pre>
  <p>How should I continue?</p>
  <p>Many thanks.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-03-16T12:31:24.807Z
Comments.Text: What is the handle of your category select field?
Comments.UserDisplayName: James Smith
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-03-16T18:28:35.480Z
Comments.Text: The handle is menuCategory @JamesSmith
Comments.UserDisplayName: mencantalamelva
Tags: <category>
Title: Show post category on an upper level page
ThreadText: # Show post category on an upper level page
  
  (Asked by: username_0 on 2023-03-15)
  
  I have a single page(index) where I'm showing all my items.
  
  [![enter image description here](https://i.sstatic.net/0j9UW.png)](https://i.sstatic.net/0j9UW.png)
  
  I have the field for setting the category on my item's section so that when I'm on the item page it shows the category of the post.
  
  [![enter image description here](https://i.sstatic.net/vshUI.png)](https://i.sstatic.net/vshUI.png)
  
  The thing is that I want to show the category of the child (item) on the index page and I'm having troubles as I don't know how to access the category from it from the page before to it.
  I mean, on the index page on "Menú barbacoa" I want that it displays on the yellow container it's category, that is "Menu estrella"
  
  For showing the items on the index page, I have a for loop looking like this:
  
  ```
  {% for item in entry.menusItems %}
          
              <li class="grid-item__li">
  
                  <div class="grid-item__category">
  
                      {% set category = craft.categories.group('menus') %}
                      <label class="item__category--label">{{ category.title }}</label>
  
                  </div>
  
  ```
  
  How should I continue?
  
  Many thanks.
  
  **Tags:** category
  
  > **Comments:**
  > **username_1**: What is the handle of your category select field?  
  > **username_0**: The handle is menuCategory @username_1  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2023-03-16. Score: 2 | Accepted answer
  
  Okey, I already solved it by investigating more.
  
  I made it work with this code:
  
  ```
  {% for item in entry.menusItems %}
          
              <li class="grid-item__li">
  
                  <div class="grid-item__category">
  
                          {% for category in item.menucategory %}
  
                              <label class="item__category--label">{{ category.title }}</label>
  
                          {% endfor %}
                          
                  </div>
  
  ```
  
  > **Comments:**
  > **username_2**: Yes! This outputs each menu item, and for each item outputs the categories that are attached to it via the menucategory field on the item. Do note that this will output a category label for every category, if more than one category is selected in that field. Nice job, and don't forget you can mark your own answer as "the accepted answer" to close this out :)  
  
  ---
  
  