Answers.Body: <p>Assuming the <em>years</em> are currently rendered in the correct (descending) order, an easy way to make sure the entries are rendered in ascending order would be to simply <a href="https://twig.symfony.com/doc/2.x/filters/reverse.html" rel="nofollow noreferrer"><code>reverse</code></a> the <code>entriesInYear</code> array, i.e.:</p>
  
  <pre><code>...
  
  {% for entry in entriesInYear|reverse %}
      ...
  {% endfor %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-24T18:48:11.430Z
Answers.Text: Jop, that works. I knew it’s gonna be an easy solution. :) Thanks a lot for the fast help!
Answers.UserDisplayName: user2190590
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-24T17:54:55.163Z
Answers.LastActivityDate: 2018-07-24T17:54:55.163Z
Answers.UserDisplayName: Mats Mikkel Rummelhoff
Body: <p>I have an archive of exhibitions with entries grouped by year. The order of the groups should be descending, the order of the entries within the group should be ascending.</p>
  
  <p>For example: The order of the years should be 2018, 2017, 2016, …
  The entries within the group 2018 should start with the first exhibition of the year and end with the last one.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>{% set archive = craft.entries.section("exhibitions").order('dateStart desc').dateEnd('&lt;' ~ now).limit(null)  %}
  {% set archiveGrouped = archive|group('dateStart.year') %}
  {% for year, entriesInYear in archiveGrouped %}
  &lt;div&gt;
      &lt;h2 class="year"&gt;{{ year }}&lt;/h2&gt;
      {% for entry in entriesInYear %}
      &lt;div&gt;
  </code></pre>
  
  <p>And the link to the Website: <a href="https://kunsthausbaselland.ch/en/ausstellungen" rel="nofollow noreferrer">https://kunsthausbaselland.ch/en/ausstellungen</a></p>
  
  <p>I guess there is an easy solution for this. But I couldn’t figure it out and found nothing in the docs.</p>
  
Tags: <entries><group><archives>
Title: Change order within grouped archive
ThreadText: # Change order within grouped archive
  
  (Asked by: username_0 on 2018-07-24)
  
  I have an archive of exhibitions with entries grouped by year. The order of the groups should be descending, the order of the entries within the group should be ascending.
  
  For example: The order of the years should be 2018, 2017, 2016, …
  The entries within the group 2018 should start with the first exhibition of the year and end with the last one.
  
  Here is my code:
  
  ```
  {% set archive = craft.entries.section("exhibitions").order('dateStart desc').dateEnd('<' ~ now).limit(null)  %}
  {% set archiveGrouped = archive|group('dateStart.year') %}
  {% for year, entriesInYear in archiveGrouped %}
  <div>
      <h2 class="year">{{ year }}</h2>
      {% for entry in entriesInYear %}
      <div>
  
  ```
  
  And the link to the Website: <https://kunsthausbaselland.ch/en/ausstellungen>
  
  I guess there is an easy solution for this. But I couldn’t figure it out and found nothing in the docs.
  
  **Tags:** entries, group, archives
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-07-24. Score: 2 | Accepted answer
  
  Assuming the *years* are currently rendered in the correct (descending) order, an easy way to make sure the entries are rendered in ascending order would be to simply [`reverse`](https://twig.symfony.com/doc/2.x/filters/reverse.html) the `entriesInYear` array, i.e.:
  
  ```
  ...
  
  {% for entry in entriesInYear|reverse %}
      ...
  {% endfor %}
  
  ```
  
  > **Comments:**
  > **username_0**: Jop, that works. I knew it’s gonna be an easy solution. :) Thanks a lot for the fast help!  
  
  ---
  
  