Search

horse is kinda stringy.

I’m using the MySQL range filtering to filter based on two URL parameters but if they aren’t defined it shows nothing. Is there a way I can only have it filter if they are defined?

The filter I’m using is:

mysql: value >= {$url-min} AND value <= {$url-max}

Again, it works when the parameters are defined but if they aren’t nothing shows up because nothing fits the range of 0–0.

I tried defining the parameters in the template by doing this:

<xsl:param name="min">
    <xsl:text>1</xsl:text>
</xsl:param>
<xsl:param name="max">
    <xsl:text>150000</xsl:text>
</xsl:param>

…But it doesn’t make a difference. The only solution I can find so far is to add the parameters to the URL and have them defined as the maximum range as default.

You could set up two datasources and select the correct one in the XSLT.

Setting the params, however, will never work as URL-params are fundamentally different from XSLT-params.

There’s an Idea I’d not thought of… Thanks for the tip, I’ll look into that more!

EDIT: Is there any way to get the number field working with multiple entries?

Number Field updated to version 1.4.1 on 12th of March 2011

It seems that

equal to or greater than 

not always does what is implied by the 'equal' part. It seems it just works the same way as simple 'greater than' pattern.

'X to B' is also not inclusive.

So how one would write a pattern wich would mean '>=' ?

Could you use the not keyword? Then equal to or greater than can be replaced with not less than.

Not sure if this is possible, just give it a try:)

:)
No, it seems that not less than is not a valid expression. Though, I'm taking back my accusations against the equal to or greater than expression. It works as it should. The problem was in my logic.

When used in a form, the number field returns with This is a required field. Instead of ‘FIELD NAME’ is a required field.

Hi Pat, this has been fixed. In future, it's a good idea to post issues on the extension repos so they don't get lost in general forum discussion :)

Brilliant thanks :)

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