• hi xnau,
    after nearly two years i have to update the page with the pdb-plugin and the updating to 1.9.7.1 from 1.9.3.14 was a little… but now almost everything works fine again. almost, because i have to sort a list by numbers, but for some reason i can not use “01” to “09” but have to use “1” to “9” in my records.
    the old version did this with
    orderby="nummer*1"
    but with the updated one it isn’t working like this (showing no list at all with the “*1”).

    i hope, it is possible to sort the list like “in former times” ??

    all the best,
    michael.

    • This topic was modified 3 years, 6 months ago by verdichtung.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author xnau webdesign

    (@xnau)

    What type of field is your “nummer” field? If you want to use leading zeroes, the field must be a text-line field. Numeric fields will not allow a number to begin with 0, only text fields can do that.

    If you want to order numerically, you must use a numeric field for that, but you cannot have leading zeroes in that case. This was enforced a long time ago, there is no going back, sorry.

    Thread Starter verdichtung

    (@verdichtung)

    thanks for your answer. i don’t want “01” instead of “1”. the “nummer” field was a text-line field and the list with orderby="nummer*1" was ascending like:
    1…
    2…
    3…

    10…
    11…
    12…
    etc.
    after the update, the *1 workaround is no longer working (no list displayed) and when i simply use orderby="nummer" the list is like:
    1…
    10…
    11…

    19…
    2…
    20…
    21…
    etc.
    and there is no difference when i change the “nummer” field to a numeric field.

    i remember, i had the problem when i first used pdb with this website… perhaps we can solve it again.

    (i’m working “offline” for the changes, so i can’t show you the lists – sorry)

    Plugin Author xnau webdesign

    (@xnau)

    Changing the field to a “numeric” type will change how the sort works, it will sort numerically instead of alphabetically.

    It is important to understand that “orderby” should get the name of the field. In your example, you’re putting a number there, it should be the name of the field you want to sort the list by. This is why it’s not giving you the sort you want.

    Plugin Author xnau webdesign

    (@xnau)

    OK, yes, that template should be updated…thanks for letting me know that was missing.

    You can add this yourself if you set it up as a custom template, then add the fieldname-based class to the template.

    Change:

    <div class="pdb-field" >

    to:

    <div class="pdb-field <?php echo $this->field->name() ?>-field" >

    I will update that template soon if you don’t mind waiting a little.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘numeric list sorting “1” “*1”’ is closed to new replies.