Skip to main content
added 164 characters in body
Source Link

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:

  1. Entry 1 with a sort_order of 10
  2. Entry 2 with a sort_order of 20
  3. Entry 3 with a sort_order of 110

Actual behavior:

  1. Entry 1 with a sort_order of 10
  2. Entry 3 with a sort_order of 110
  3. 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.

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:

  1. Entry 1 with a sort_order of 10
  2. Entry 2 with a sort_order of 20
  3. Entry 3 with a sort_order of 110

Actual behavior:

  1. Entry 1 with a sort_order of 10
  2. Entry 3 with a sort_order of 110
  3. 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 "?

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:

  1. Entry 1 with a sort_order of 10
  2. Entry 2 with a sort_order of 20
  3. Entry 3 with a sort_order of 110

Actual behavior:

  1. Entry 1 with a sort_order of 10
  2. Entry 3 with a sort_order of 110
  3. 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.

added 226 characters in body
Source Link

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:

  1. Entry 1 with a sort_order of 10
  2. Entry 2 with a sort_order of 20
  3. Entry 3 with a sort_order of 110

Actual behavior:

  1. Entry 1 with a sort_order of 10
  2. Entry 3 with a sort_order of 110
  3. 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 "?

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.

Expected behavior:

  1. Entry 1 with a sort_order of 10
  2. Entry 2 with a sort_order of 20
  3. Entry 3 with a sort_order of 110

Actual behavior:

  1. Entry 1 with a sort_order of 10
  2. Entry 3 with a sort_order of 110
  3. 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"}

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:

  1. Entry 1 with a sort_order of 10
  2. Entry 2 with a sort_order of 20
  3. Entry 3 with a sort_order of 110

Actual behavior:

  1. Entry 1 with a sort_order of 10
  2. Entry 3 with a sort_order of 110
  3. 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 "?

Source Link

How can I sort entries by ascending integers?

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.

Expected behavior:

  1. Entry 1 with a sort_order of 10
  2. Entry 2 with a sort_order of 20
  3. Entry 3 with a sort_order of 110

Actual behavior:

  1. Entry 1 with a sort_order of 10
  2. Entry 3 with a sort_order of 110
  3. 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"}