notes: This was originally going to be a separate page on the new docs site but it now makes more sense to keep everything within the templates/lists page. - rdwatters, 2017-03-12.
This list template is used for [spf13.com](https://spf13.com/). It makes use of [partial templates][partials]. All examples use a [view](/templates/views/) called either "li" or "summary."
<divclass="meta">{{ .Date.Format "Mon, Jan 2, 2006" }}</div>
</li>
{{ end }}
{{</code>}}
### By Parameter
Order based on the specified front matter parameter. Content that does not have the specified front matter field will use the site's `.Site.Params` default. If the parameter is not found at all in some entries, those entries will appear together at the end of the ordering.
The below example sorts a list of posts by their rating.
{{<codefile="layouts/partials/by-rating.html">}}
{{ range (.Pages.ByParam "rating") }}
<!-- ... -->
{{ end }}
{{</code>}}
If the front matter field of interest is nested beneath another field, you can
{{ range .Pages.GroupByParamDate "param_key" "2006-01" }}
<h3>{{ .Key }}</h3>
<ul>
{{ range .Pages }}
<li>
<ahref="{{ .Permalink }}">{{ .Title }}</a>
<divclass="meta">{{ .Date.Format "Mon, Jan 2, 2006" }}</div>
</li>
{{ end }}
</ul>
{{ end }}
{{</code>}}
### Reverse Key Order
The ordering of the groups is performed by keys in alphanumeric order (A–Z, 1–100) and in reverse chronological order (newest first) for dates.
While these are logical defaults, they are not always the desired order. There are two different syntaxes to change the order, both of which work the same way. You can use your preferred syntax.
#### Reverse Method
```
{{ range (.Pages.GroupBy "Section").Reverse }}
```
```
{{ range (.Pages.GroupByDate "2006-01").Reverse }}
```
#### Provide the Alternate Direction
```
{{ range .Pages.GroupByDate "2006-01" "asc" }}
```
```
{{ range .Pages.GroupBy "Section" "desc" }}
```
### Order Within Groups
Because Grouping returns a `{{.Key}}` and a slice of pages, all of the ordering methods listed above are available.
In the following example, groups are ordered chronologically and then content
within each group is ordered alphabetically by title.