{count 'orders'} is an "is there anything in it" test: its content renders when
the data set or the page array named orders holds at least one element, and its
@else@ part renders when it is empty. A typical use is a heading and a table that
only appear when there are rows, with a "nothing found" text otherwise.
Despite its name the tag prints no number. The number of rows of a loop is the
count@orders property, readable inside the loop and in conditions. The name is
looked up as a {data} set first, then as a variable of the page. A
variable that does not exist, or is NULL, holds nothing; one that holds a single plain value
counts as holding that value.
Write the name quoted: {count 'orders'}. {count $orders} evaluates
the array itself as the name, which is an error. Inside a loop, the data tag's own
@else@ part already shows when it has no rows - {count} is for
markup around the loop.