# What is the correct behavior for range .Pages.ByWeight.ByDate.ByTitle?

**URL:** <https://discourse.gohugo.io/t/what-is-the-correct-behavior-for-range-pages-byweight-bydate-bytitle/36210>\
**Category:** support\
**Created:** [December 24, 2021, 2:44pm UTC](https://discourse.gohugo.io/t/what-is-the-correct-behavior-for-range-pages-byweight-bydate-bytitle/36210 "2021-12-24T14:44:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cshoredaniel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/cshoredaniel/32/19684_2.png) [@cshoredaniel](https://discourse.gohugo.io/u/cshoredaniel)\
**Post date:** [December 24, 2021, 2:44pm UTC](https://discourse.gohugo.io/t/what-is-the-correct-behavior-for-range-pages-byweight-bydate-bytitle/36210/1 "2021-12-24T14:44:18Z")

</div>

Before I go and create a sample repo and all, I’ve got a question about what is the expected behavior with what I’m doing.

I’ve got `{{ range .Pages.ByWeight.ByDate.ByTitle }}` but instead of ordering by weight, then date, then title, Hugo is ordering purely by title.

Is this expected or should I be creating a reproducible test case and looking at why it’s not doing what I expect?

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [December 24, 2021, 3:44pm UTC](https://discourse.gohugo.io/t/what-is-the-correct-behavior-for-range-pages-byweight-bydate-bytitle/36210/2 "2021-12-24T15:44:16Z")

</div>

> [@cshoredaniel](#):
>
> Is this expected

Yes, this is expected; last one wins. You can achieve SQL-like multi-column ordering through grouping.

---

<div class="post-metadata">

**Author:** ![cshoredaniel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/cshoredaniel/32/19684_2.png) [@cshoredaniel](https://discourse.gohugo.io/u/cshoredaniel)\
**Post date:** [December 24, 2021, 4:14pm UTC](https://discourse.gohugo.io/t/what-is-the-correct-behavior-for-range-pages-byweight-bydate-bytitle/36210/3 "2021-12-24T16:14:15Z")

</div>

Thank you, that’s what I’ve ended up doing, but I wanted to know if it was a bug or expected.

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [December 26, 2021, 4:14pm UTC](https://discourse.gohugo.io/t/what-is-the-correct-behavior-for-range-pages-byweight-bydate-bytitle/36210/4 "2021-12-26T16:14:58Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
