Search

A new Extension, “Number Field” is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on the issue tracker.

This is a field specially for storing numbers. As such, it has support for natural sorting, something a normal input field cannot offer. For more information, see http://bugs.21degrees.com.au/comments.php?DiscussionID=221

Hey, neato!

If you pass SORT_NUMERIC to your PHP *sort() functions, they can sort strings as if they were numbers.

http://us2.php.net/manual/en/function.sort.php

Creating a new field type for this purpose seems more efficient and less invasive in the interface. Also, there are benefits to storing numeric data in a database as numeric.

I know, it makes sense. I just thought I'd point out that it was possible to sort strings as numbers.

davethegr8: Yes, you are correct. The problem is that the input field doesn't have any extra settings to specify if it will only ever contain numbers. Also, the sorting is not done via PHP, but rather MySQL. It is not possible to correctly paginate otherwise.

You know what would be nice to have that could utilize this field type? A range filter. For example, say I had a product list and I wanted to pull certain products within a price range.

That'd be nice.

Unless this is already implemented and I missed it. In which case you can all flog me with wet noodles.

Not a bad idea. I'll think about implementing that.

In which case you can all flog me with wet noodles.

Can we do it anyways for coming up with a great idea?

Not a bad idea. I'll think about implementing that.

I agree.

Your wish has been granted. As per the readme:

  • Filtering supports ranges via the use of MySQL expressions. To filter by ranges, add 'mysql:' to the beginning of the filter input. Use 'value' for field name. E.G. mysql: value >= 1.01 AND value <= {$price}

Grab it up top of this thread - v1.2, or here

Awesome! Now, to go find some noodles for flogging.

This extension is a must have for all symphony developers. I discovered a small bug: when I leave an unrequired number field empty it will throw an error saying that the field must be a number.

Thanks carsten. Ill fix that up.

Very handy. Thanks for putting this out.

I notice that it truncates any trailing zeros. (I.e. 33.00 = 33; 33.50 = 33.5)

Is there any way to set a fixed # of decimal points for more consistent display within entries (in the admin)? If not, can XSLT handle to conversion upon display?

Best, Clayton

maybe XSLT's format-number?

Thanks Craig.

I'm still getting up to speed on all the wonderous possibilities of XSLT ;)

Best, Clayton

I discovered a small bug: when I leave an unrequired number field empty it will throw an error saying that the field must be a number.

Alistair, did this end up getting fixed in v1.2?

I'm currently getting the same or similar error. In this case I've first noticed it when the field was set to 'required', had data entered, was then set to optional, and tried to have data deleted, leaving the field blank.

The more I use Symphony the more I'm amazed by what you guys have done / are doing in terms of building a great tool and supporting it. Not quite sure how you pull it all off; please let me know where to send the gold-filled truffles and technicolor ponies as thanks.

Best, Clayton

Ahh, you're right. I never got around to it. I've uploaded a new version above.

please let me know where to send the gold-filled truffles and technicolor ponies as thanks.

Awesome. I was running low!

Ahh, you're right. I never got around to it. I've uploaded a new version above.

Great. Thanks! Truffle filled ponies are currently en route.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details