We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying to order a list of related records by a number field (mode: float), like this:
{% set relatedrecords = record|related('songs') %} {% for related in relatedrecords|order('tracknumber') %} <p>{{ related.tracknumber }}, {{ related|title }}</p> {% endfor %}
My contenttype field:
tracknumber: type: number mode: float
But my list of records does not follow the ordering I want.
There is a dirty workaround for those who need it quickly, like moi :)
{% set relatedrecords = record|related('songs')|sort((a,b) => a.tracknumber <=> b.tracknumber) %} {% for related in relatedrecords %} ... {% endfor %}
The text was updated successfully, but these errors were encountered:
Tagged as documentation issue, thanks!
Sorry, something went wrong.
ContentHelper::get()
I-Valchev
Successfully merging a pull request may close this issue.
I'm trying to order a list of related records by a number field (mode: float), like this:
My contenttype field:
But my list of records does not follow the ordering I want.
There is a dirty workaround for those who need it quickly, like moi :)
The text was updated successfully, but these errors were encountered: