Search

I have a page that uses a form to fill in parameters needed for a dynamic data source. What's awkward is that when you display the page for the first time and parameters are empty the page still executes the data source (with empty params) which takes a long time for the external link to process (it returns a huge XML file when there are empty params in the request). So it looks like a 10 sec delay when you load the page for the first time. It it possible to tell the DS to only execute when params are ready?

Thank you,

You could edit your data source and add the following to the beginning of the grab() method:

if(empty($_GET['param1']) || empty($_GET['param2'])) { return $this->emptyXMLSet(); }

Don’t forget to set allowEditorToParse() to return false so you won’t accidentally override these changes.

It would be much easier to have default values in the parameters that would force the external DS to return no results than start playing with the underlying logic.

How have you got the URL set up for the external DS, are there any values you could use as defaults?

If that can't be done then @tachyondecay's solution is the next best answer.

It's third party api and by default (when it's empty) they return everything. I also think that tachyondecay's suggestions should work. Thank you,

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