Skip to main content

Craft 2

Either of these should work (they are equivalent):

{% set entries = craft.entries.width('> 0').section('windows').order('width') %}

or

{% set entries = craft.entries({
  section: 'windows',
  order: 'width',
  width: '> 0'
}) %}

The reason you are getting "Array to string conversion" error is that find has turned your ElementCriteriaModel into an array.

Craft 3

order is now orderBy

Craft 3 Docs: Element Queries

Either of these should work (they are equivalent):

{% set entries = craft.entries.width('> 0').section('windows').order('width') %}

or

{% set entries = craft.entries({
  section: 'windows',
  order: 'width',
  width: '> 0'
}) %}

The reason you are getting "Array to string conversion" error is that find has turned your ElementCriteriaModel into an array.

Craft 2

Either of these should work (they are equivalent):

{% set entries = craft.entries.width('> 0').section('windows').order('width') %}

or

{% set entries = craft.entries({
  section: 'windows',
  order: 'width',
  width: '> 0'
}) %}

The reason you are getting "Array to string conversion" error is that find has turned your ElementCriteriaModel into an array.

Craft 3

order is now orderBy

Craft 3 Docs: Element Queries

Source Link
Marion Newlevant
  • 12.1k
  • 1
  • 23
  • 55

Either of these should work (they are equivalent):

{% set entries = craft.entries.width('> 0').section('windows').order('width') %}

or

{% set entries = craft.entries({
  section: 'windows',
  order: 'width',
  width: '> 0'
}) %}

The reason you are getting "Array to string conversion" error is that find has turned your ElementCriteriaModel into an array.