Search

I encountered a scenario where I needed to place two values in to the “Required URL Parameter” field in the Datasource Editor, not to make them both required, but instead to make at least one match.

Just add a colon in between each parameter. Symphony will start at the beginning and go through each parameter until one has a value:

multiple required parameters

Only if none of the parameters have values will Symphony return a “No records found” error.

Cool!

could this be somehow used to fallback on an available langauge?
You have a param with the browser language , for instance ‘af’ (afrikaans) since no afrikaans is available, I’d have to serve english, which is set as the fallback param ‘en’

if no match for param 1, then use param 2

dont think so…

$language:$fallback-language

Then create a parameter named “fallback-language” with a static value of “en” using the Global Parameter Loader extension. That might work.

Sure, you wouldn’t even need to use a static variable. If you want to have a fallback like that, you shouldn’t be using this input field. Check out the Data Sources Filter Results. All you would have to do is this for one of your filters:

$language:en

Then, leave Required URL Parameter blank, this would do a fallback. This is known as an Enumeration Filter.

This cannot be applied in dynamic datasources?
I have found that it is not possibel to use {$variable} which is defined (test logic, or some other rules) in a page, as filter in the dynamic URI.
So if you want to manipulate the dynamic datasources are fetched (without hackign the php of one) you are stuck?

For instance i would like to filter by ‘foo-bar’ but my DDS feed only excepts ‘FooBar’. There is no way I can get to use ‘foo-bar’ as page paramhandel, and yet serve my feed ‘FooBar’ requests?

@newnomad, are you using the {} braces? They should not be used in the “Required URL Parameter” field.

isn’t that similar to the Filter Results fields? where you can put in params in the order you want them if one should fail and then you can add a static string value if none are present? this is really similar to the || operator in javascript.

@ sirlancelot, I’m talking about dynamic datasources (aka external feeds), th eonly option you have there is Use {$param} syntax to specify dynamic portions of the URL.

So the essence of the starting post here is;

you can use the same rules(combinations, as in the DS docs) you would for filtering, for required params

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