ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Make EE realize that 10 does not come between 1 and 2

October 09, 2008 8:39pm

Subscribe [3]
  • #1 / Oct 09, 2008 8:39pm

    DavidB

    11 posts

    So I’m making a set of posts that I want to be able to reorder as I see fit (it’s a gallery, actually, but that shouldn’t matter). For each post I have a custom text field called ‘image-position’. I put a number in here, which I can change to reorder the posts. It works perfectly for 1 to 9, but post 10 is rendered by EE between posts 1 and 2. Clearly EE is only looking at the first digit, not reading the whole number - any solutions?

    Out of interest, here’s the relevant line of code:

    {exp:weblog:entries weblog="photos" disable="catgories|member_data|pagination|trackbacks" orderby="image-position" sort="asc"}

    I don’t really want to have to fudge it with entries like ‘1a, 1b ... 1z, 2a, 2b…’, etc. But any help is gratefully received!

    EDIT: I did see the following thread, by the way, but it didn’t seem to have a solution:
    http://ellislab.com/forums/viewthread/90628/

  • #2 / Oct 09, 2008 9:36pm

    allgood2

    427 posts

    It’s a text field, if you want numbes to order properly, you’ll need to use 01, 02, 03, ... 10, 11, etc.

  • #3 / Oct 09, 2008 10:23pm

    PXLated

    1800 posts

    Everyone must be discovering this today, there are probably four new threads all about text/numbers 😊

  • #4 / Oct 10, 2008 6:43am

    DavidB

    11 posts

    Thanks allgood2 for the suggestion about 01, 02, etc. It’s a shame that you would then have to know in advance how many entries you would expect to have (ie, start with 01 or 001 or 0001). But it’s a good enough solution for the moment!

    The idea in another thread about changing the SQL database field to INT (integer) is another good solution, as mentioned in this thread:

    http://ellislab.com/forums/viewthread/93368/

    ...but I’m an HTML CSS coder and don’t know much about changing the database settings! It would be nice if EE gave you the option in the custom field settings to set as a field as an integer (as well as the current options of text, date, etc).

    I see that the REEOrder Module might be useful in this instance, too:

    http://ellislab.com/forums/viewthread/43903/

    Thanks again!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases