I am trying to use a custom field sort_order
to order entries by setting the Field Content type of a Text Input to Integer.
I'm using EE2.
Expected behavior:
- Entry 1 with a
sort_order
of 10 - Entry 2 with a
sort_order
of 20 - Entry 3 with a
sort_order
of 110
Actual behavior:
- Entry 1 with a
sort_order
of 10 - Entry 3 with a
sort_order
of 110 - Entry 2 with a
sort_order
of 20
Channel Field:
- Field Type: Text Input
- Field Label: Sort Order
- Short Name: sort_order
- Field Options > Field Content: Integer
Template:
{exp:channel:entries channel="work" orderby="sort_order" sort="asc"}
Update
I tried creating a plugin and setting orderby
like this: orderby="{exp:parse_int data={sort_order}}"
. Won't entry parameters always be converted to strings since they are wrapped in "
?
Update
Decided to just ensure that my number strings are two digits long so they are in the correct alphabetical order e.g. 01 02 03... 99
.
entry #50, entry #9, entry #880
, you give entry #50 the oldest (or newest) date, and entry #9 a date in between the other two.