Search

A new extension, "Parametrisator" is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on github issue tracker.

Two words: Awe. Some.

I'm a bit too tired to wrap my had around all the possibilities, but this sounds awesome! Data Source Chaining on 'roids.

@ahwayakchih - again, you amaze me!

You win money!

Thank you :).

Trying to understand this. Am I correct in assuming you expose this in a DS and allow extra $ds-ds-name-*field* fields to filter additional DS'es on?

So, normally you would be able to filter additional, chained, DS'es by one of the given fields in the Use field output, but this extension provides us more values (accessible by, e.g. XPATH of current DS XML)?

So, in your example, translated-title was not originally available as a field to filter on?

Update: and how does this extension relate to/work with the planned Multiple output parameters?

Am I correct in assuming you expose this in a DS and allow extra $ds-ds-name-field fields to filter additional DS'es on?

Almost. It does not have to be a field. It may be anything you can select from XML output of the edited data-source.

So, in your example, translated-title was not originally available as a field to filter on?

Correct. I guess i need to change screenshot a bit more. Data-source that is visible there, outputs a field that contains some pre-generated XML (it can be HTML, or whatever you want, in this case it was XML containing static translations from English to Polish). XPath specified for Parametrisator works on that XML data, and creates new parameter $ds-dsname-translated-title, which can be used by other data-sources to filter their output. You just need to make sure that Parametrisated data-source will be called before those other data-sources.

and how does this extension relate to/work with the planned Multiple output parameters?

You really should read the README :). I wrote this extension before Multiple output parameters were implemented into the core. But it adds more features than just a way to output fields as parameters (for which core's new feaure might be a better choice now, as long as you do not need additional computations on it, because it will work faster). It does not need to be a field at all :).

Parametrisator allows you to output parameters based on data found in StaticXML and DynamicXML data-sources. It also allows you to apply XSLT before XPath is used on them, so it may be used for a lot of stuff. For example, you can output parameter conditionally (depending on data found in XML). In extreme corner-case, voodoo magic situation, you can build multi-pass XML generator (build page that outputs some data, create DynamicXML that gets that data and outputs parameters, build other data-sources that filter their data by those parameters, build page that uses those data-sources to output XML data, create DynamicXML... probably unlikely situation, but now it is possible to implement - you can build whatever hell you want for yourself ;).

Thanks for the explanation @ahwayakchih. It sounds like a very powerful extension (although I'm yet to think of some scenario where I would need it).

I'll try and stay away from "extreme corner-case, voodoo magic situations" in general but your very last sentence is appealing ;)

Thanks for the explanation @ahwayakchih. It sounds like a very powerful extension (although I'm yet to think of some scenario where I would need it).

We use it for a few things in current project (i will link to it later, right now it is not finished and is not yet ready to be visited):

  • filter data-source by category names that may be specified in any of supported languages (that is why there was translated-title),
  • we use DynamicXML as a way to cache some entry lists, and to update that cache we pass date of latest entry to it. To prevent adding yet-another-data-source just for that date, we generate "latest-date" from regular data-source that outputs multiple entries,
  • we use it in other places to prevent adding data-sources just for a single value parameter,
  • we do use it to output more than one field as parameter (as i wrote, first version was written some time ago, when multiple output parameters were not implemented, and we did not update Symphony yet as it contains stuff that may break things on our side),
  • we will (i am still working on it) use it to select all linked news and other "objects" from articles and get some basic information about them using another data-source(s). That way authors will not have to remember to include them in SubsectionManager fields (especially if they will write articles offline, and just use special markers for things like: "(link to that-news here) blah bla blah [embed that-object here] yada yada" - it will make their life easier :).

We do not use XSLT with it yet, but i thought it may be useful to have that possibility in future :).

I can only say: wow!

Just needed & used it. Sweet :)

Thank you :).

Parametrisator updated to version 1.2 on 3rd of January 2012

Just seeing this for the first time. Awesome!

Can I use this extension to provide filtering for my dynamic data source? Please see this thread

It seems like if I use data chaining using the parametrisator extension, the primary data source should always go before the dependent data sources. Currently they seem to be sorted by the name so if my primary data source comes after the secondary source, the secondary source gets empty parameters. Can it be fixed?

@Trastabuga Yes. Use this syntax for parameters to make sure the datasources are loaded in the right order:

{$ds-articles:$ds-articles-bibliography-handles}

See section "Known problems" in the readme on GitHub.

@jensscherbl. My primary ds is section based and my secondary ds are dynamic xml which don't have any filtering options. How can I apply your solution in this case?

I used this in a basic way for the first time today - many thanks. :-) It's great to to have the option of additional data source output parameters in 2.2, as well as the XSLT capabilities for future use.

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