Search

I’m trying to filter a textarea within a datasource using regex and the following works fine.

regexp:{$url-description}

However, on my front end I want to initallly load all the entries to begin with and I can no longer do this without passing a $description value. I can get around this right now by using ‘job-search/?description=a’ since all the entries will contain that character but I have other filters (not using regex) that aren’t applied if the parameters are empty and was wondering how do I go about filtering using regex in the same manner. ie ignore the filter if the value is empty.

Any help much appreciated.

ok so I’ve fixed this now by edditing the data source file directly. Since you can’t delete posts and just in case someone has the same problem, all I did was add to the grab function an if statement to check if the submitted variables are empty. If they are then remove the regex string.

If anyone knows of a better way to do it…

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