Search

Hi!

Talking about a standard DS. I want to filter entries by their system id's.
Assume the name of the parameter is 'id'.
So, the classical way would be just to set the filter pattern to:

{$id}

The problem is, that if the parameter does not exist, all the entries are returned.
But I want it to return no entries in that case.
I tried different patterns, and the only one which seem to work is:

{$id} to {$id}

I wonder, may be it is just a coincidence, and the results will not be consistent through Symphony or php or whatever versions changes? Also, I wonder why the other patterns did not work, like:

regexp: {$id}

or

equal to {$id}

The two above never match.

Use parameters fallback: {$id:0}

Thanx!

Or, even better; there is an option for that! It's below the filtering, look for "return no results when parameter is not set".

Hm, I don't see anything like "return no results when parameter is not set" in my data sources setup. Is it added to some newer than 2.3 Symphony version?

Here

Add a parameter, and if it isn't set, no results will be returned.

Ah! I keep forgetting about this "Required URL Parameter" thing.
The fact that it is placed in the "Output Options" part of the form always confuses me.

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