Search

So when you attach a “normal” datasource to a page, you’re given all sorts of filtering options and a Required URL parameter which allow you to customise how the DS is loaded.

Howcome there is practically nothing available when using a Dynamic XML datasource? Specifically, I have multiple dynamic XML DS’s all attached to a single Symphony page, but want to selectively load them depending on the entry being viewed or at least a URL parameter. Can anyone suggest a way of achieving this?

Cheers, John

I guess the best way would be to pass your parameters via the Dynamic Data Source URL to a custom PHP script that takes care of the rest.

Thanks for you quick reply, but I’m not sure I follow…

Well, you can use URL parameters in your Dynamic Data Source URL like so:

http://somesour.ce/myfancyscript.php?category={$category}&title={$title}

In this case myfancyscript.php should contains a custom PHP script that returns the needed XML based on your URL parameters.

Hmm interesting workaround. I suppose I can still rely on the Symphony caching for this too, so the contents of myfancyscript.php could really just be a call to file_get_contents() inside a few if statements… thanks for the idea!

Exactly, Johanna and I have been using this method for the website of a local yarn store which stores its product information in an Access database which was exported as XML. As the XML really became huge, we cut it into smaller chunks with only the needed information based on URL parameters. It really works great, it is good for performance reasons and, yes, you can rely on Symphony’s caching.

@jstar198 and @Nils -

Have y’all ever used the Filter Field? Here’s the thread where ahwayakchih documents on how to use it. I found it very useful, and found that it works fine with 2.1.1.

If y’all end up using it, I’d love to hear your feedback. I’m always trying to find ways to use it more efficiently.

@bzerangue Cool extension, but I cannot see how this would apply to Dynamic XML data sources; from what I can tell it still only applies to Symphony sections.

@jstar198 - Forgive me, I misread your post, I saw you mentioning filtering your data sources, so I offered that one up. You can always use params to in your dynamic sources to filter them, like Nils mentioned above. What kind of dynamic source are you pulling in?

You can always use params to in your dynamic sources to filter them

Well that’s assuming that you have control over the source, but when it’s something 3rd party like a news feed or twitter stream you are totally at their mercy with regards to what you cna filter.

Nils’ solution is quick to implement and works quite well; Mostly I was just surprised that there aren’t more options available within Symphony itself for doing this.

Or you could always use the XML Importer and setup a crontab (to automatically import the data into your Symphony install).

Interesting extension, didn’t know about that one. Thanks :)

@jstar198 - Here’s a screencast from nickdunn of the extension at work. FYI… this a screencast of an older version of the extension, so the extension has changed some (for the better), but the functionality is the same.

Also, you might find the XML Importer thread helpful as well.

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