Skip to content

[RFC] Allow order by taxonomy #1693

@nestordedios

Description

@nestordedios

I don't know how difficult this might be to implement, but it would be nice to have.

When using {% setcontent %} it would be nice if you could order the result of the query by a Taxonomy.

To create a list of records ordered by Taxonomy you will need to do something like this:

  1. Get taxonomy options
  2. Iterate over Taxonomy options array
  3. Get all Records for the Taxonomy option in the loop
  4. Print Records as you iterate.

For example:

{% set regions = config.get('taxonomies/regions/options') %}
{% for region in regions %}
    <h2>{{ region }}</h2>
    {% setcontent locations = 'locations' where { regions: region } %}
    {% for location in locations  %}
        <h3>{{ location.title }}</h3>
    {% endfor %}
{% endfor %}

This would cost a lot of extra Database queries when fetching the records per taxonomy value. If something like this could be triggered from the Backend and just iterate over Records array it would be nicer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions