Answers.Body: <p>I'm not seeing any obvious ways to access groups directly in Twig. There may be a more direct way, idk — but this should work.</p>
  
  <pre><code>{% set categoryGroupNames = [] %}
  {% for category in craft.categories %}
      {% set groupName = category.getGroup.name %}
      {% if groupName not in categoryGroupNames %}
          {% set categoryGroupNames = categoryGroupNames|merge([groupName]) %}
      {% endif %}
  {% endfor %}
  
  {% for groupName in categoryGroupNames %}
      {{ groupName }}
  {% endfor %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-14T20:52:09.310Z
Answers.LastActivityDate: 2015-05-14T20:57:47.373Z
Answers.LastEditDate: 2015-05-14T20:57:47.373Z
Answers.UserDisplayName: Douglas McDonald
Body: <p>I've looped through individual category groups to find each parent/child category, but is there a way to loop through and only show Category Group names?</p>
  
Tags: <categories><category><group><loop>
Title: Loop through category groups
ThreadText: # Loop through category groups
  
  (Asked by: username_0 on 2015-05-14)
  
  I've looped through individual category groups to find each parent/child category, but is there a way to loop through and only show Category Group names?
  
  **Tags:** categories, category, group, loop
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-05-14. Score: 3 | Accepted answer
  
  I'm not seeing any obvious ways to access groups directly in Twig. There may be a more direct way, idk — but this should work.
  
  ```
  {% set categoryGroupNames = [] %}
  {% for category in craft.categories %}
      {% set groupName = category.getGroup.name %}
      {% if groupName not in categoryGroupNames %}
          {% set categoryGroupNames = categoryGroupNames|merge([groupName]) %}
      {% endif %}
  {% endfor %}
  
  {% for groupName in categoryGroupNames %}
      {{ groupName }}
  {% endfor %}
  
  ```
  
  
  ---
  
  