1 users online. Create an account or sign in to join them.Users

Search

I have section with entries that are associated with years using a Select Box Link field. The list of years is growing over the years (ha, great idea, isn't it?) and there are entries that are valid for all years, even those that are not available as options in the select: those entries have no year attached at all.

Filtering my Data Source to match only the entries of the currently selected year is easy:

{$year}

But I'd like to return all entries that either match the given year or have no year attached at all. My guess is that a regular expression might help but those are not my field of expertise.

Any tips how to apply the needed filtering?

Okay, this seems to work if used separately:

  • {$year:$this-year} will match entries that are attached to the current $year (or $this-year, if the page parameter is not set).
  • sql: NULL will match all entries that have no year attached.

For some reason, it's not possible to chain these rules: neither {$year:$this-year}, sql: NULL nor sql: NULL, {$year:$this-year} apply both filter rules.

Any ideas?

Edit: Right, read the read me. "Please note that predicate filters, such as not: or sql:, will ignore all other data source filters for that field." ~ damn.

Is there a specific reason why the sql: filter ignores all other fields?
It doesn't make much sense to me.

Is there a specific reason why the sql: filter ignores all other fields?

It's far easier to parse if one assumes the predicate trumps everything else. What if your predicate value included a comma?

Fair point.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.2 or above
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.0 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details