All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Altering the Sort Order String

briankalwat 28 Aug 2010 02:55 question, complete

Hi!

I just purchased the Reorder add on, and i'm wanting to implement it for a jQuery rotater that I have built on an existing site. Currently, i'm sorting the entries using a custom field that is a single integer 1-9. When I change that field to the Reorder fieldtype, it doesn't work well with the existing javascript, because Reorder orders entries using a 4 digit numerical string. Is there a way to alter the addon to only use a single digit as the sort order? (i'll never need more than 9 entries sorted at once for this particular site.)

Thanks!

Brian

Replies

  1. Low 28 Aug 2010 09:27

    Hey Brian,

    I take it you need the output of the reorder fieldtype to be without leading zeroes? You could achieve that by using my Low Replace plugin (which is free). Try this:

    {exp:low_replace find="^0+(\d+)$" replace="$1" regex="yes"}{my_reorder_field}{/exp:low_replace}

  2. briankalwat 24 Sep 2010 20:05

    That worked great Low. One last question, what would be the quickest way to set the reorder origin to 1 instead of 0? I can set the entries tag to offset="1", but then I have to have a filler entry, and that's not the best case scenario...

  3. Low 25 Sep 2010 06:56

    I think there might be a simple calculation plugin on Devot:ee somewhere -- you could try that.

    I'll also look into making this sort of thing configurable (or just start with 1 instead of 0) for the next release.

  4. Low 7 Oct 2010 07:48

    Hey Brian,

    Low Reorder v1.0.5 now strips the leading zeroes off by default. You can also optionally add them by using the padding="" parameter. For example:

    {low_reorder_field padding="2"}

  5. briankalwat 27 Nov 2010 18:57

    Thanks so much Low!

    I tried to log in to Devot:ee to download the latest version, but for some reason, it appears as though the have reset my account and there is no longer record of my purchase of any plugins. I have emailed them about this, and included my original purchase receipt, but have yet to hear a response.

    If I forward you my receipt email from Devot:ee, is there a chance that you could provide me with the means to get the update?

    I can just wait for them to respond, but I'd like to make some changes to a site and implement your update as soon as I can. Thanks again for your help.

    Brian

  6. Low 28 Nov 2010 09:16

    Hey Brian,

    Sure, drop me an email at lodewijk at gmail dot com with your details and license key and I'll send you a copy.

  7. briankalwat 28 Nov 2010 09:23

    Low,

    I got a response back from support at Devot:ee this afternoon. Turns out I purchased the plugin using the client's account instead of my own. (since it was for their site.) I've updated it along with the site now and everything is working flawlessly. Thanks!

    Brian