Search

I'm trying to figure out a way to multiply or divide a url-parameter to filter entries within a data source. Using a number field here's my filter

{$url-min:0} to {$url-max:10000000}

I want to enter something in like

{$url-min div 1.25:0} to {$url-max div 1.25:10000000}

Entries are dynamically loaded from another page and numbers are different due to conversion. Anybody have any ideas?

You can't do this within the normal data source syntax. But if you're comfortable editing PHP, you can customise the DS file and add this quite easily. Find the data source file, remove the allowEditorToParse method (so you can't open the DS in Symphony again and thereby possibly overwrite your custom additions) and find the grab method. Here you can modify the filters, e.g:

$this->dsParamFILTERS['field-id'] = 10000;

The field-id part will be the field ID you're filtering on. If you've already got a filter on this field before you make your customisations, the ID will already be in the filters array at the top of the file.

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