# How do I sort all pages from within nested subsections?

**URL:** <https://zola.discourse.group/t/how-do-i-sort-all-pages-from-within-nested-subsections/66>\
**Category:** Support\
**Created:** [March 2, 2019, 5:03am UTC](https://zola.discourse.group/t/how-do-i-sort-all-pages-from-within-nested-subsections/66 "2019-03-02T05:03:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ikevin8me](https://avatars.discourse-cdn.com/v4/letter/i/8c91f0/32.png) [@ikevin8me](https://zola.discourse.group/u/ikevin8me)\
**Post date:** [March 2, 2019, 5:03am UTC](https://zola.discourse.group/t/how-do-i-sort-all-pages-from-within-nested-subsections/66/1 "2019-03-02T05:03:08Z")

</div>

I have the following code:

```
{% set_global pages = [] %}
  {% for subsection_path in section.subsections %}
    {% set subsection = get_section(path=subsection_path) %}
    {% set_global pages = pages | concat(with=subsection.pages) %}
{% endif %}

```

As you can see, I’ll have the “pages” array with all the pages from all subsections within. The problem is this is unsorted.

I’d like to sort these “pages” by **date**. How can I do this?

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [March 2, 2019, 9:34am UTC](https://zola.discourse.group/t/how-do-i-sort-all-pages-from-within-nested-subsections/66/2 "2019-03-02T09:34:10Z")

</div>

I think you want to use **transparent** sections: [https://www.getzola.org/documentation/content/section/#front-matter](https://www.getzola.org/documentation/content/section/#front-matter)
