Contenttype:
packages:
name: Pakketten
singular_name: Pakket
fields:
name:
label: Naam
type: text
price:
label: Prijs
type: number
mode: integer
step: 1
order:
type: number
mode: integer
step: 1
label: Volgorde
viewless: false
When I use {% setcontent packages = 'Pakketten' orderby 'order' %}, packages has no items.
When I use {% setcontent packages = 'Pakketten' %}, it has the items I expect (but obviously not ordered the way I want)
I used printquery on both.
The first one shows:
SELECT content FROM Bolt\Entity\Content content LEFT JOIN content.fields fields_order_1 LEFT JOIN fields_order_1.translations translations_order_1 WHERE content.contentType = :ct0 AND content.status = :status_1 AND fields_order_1.name = :order_1 AND translations_order_1.locale = :order_1_locale ORDER BY lower(translations_order_1.value) ASC
ct0: pakketten
status_1: published
order_1_locale: en
order_1: order
The second one shows:
SELECT content FROM Bolt\Entity\Content content WHERE content.contentType = :ct0 AND content.status = :status_1 ORDER BY content.publishedAt DESC
ct0: pakketten
status_1: published
I noticed that in the first query, order_1_locale is set to en, whereas my site is configured to be nl. nl is the only locale.
Details
| Question |
Answer |
| Relevant Bolt Version |
4.0 master (dev-master 781cd66) |
| Install type |
Composer install |
| PHP version |
7.4.7 |
| Web server |
symfony |
Contenttype:
When I use
{% setcontent packages = 'Pakketten' orderby 'order' %},packageshas no items.When I use
{% setcontent packages = 'Pakketten' %}, it has the items I expect (but obviously not ordered the way I want)I used
printqueryon both.The first one shows:
The second one shows:
I noticed that in the first query,
order_1_localeis set toen, whereas my site is configured to benl.nlis the only locale.Details