Search

Data sources can be filtered by parameters but not grouped by them. On a page I want to offer views in which things are grouped differently. I can group in xsl but it would be easier (and I guess faster on the server) to get this done already in the data source.

Is there any trick to group by a parameter?

by parameters

You mean by parameter's values? Or not? Whats an example of that?

Parameters provide actual field's values and datasource can be grouped by field's values.

I can group in xsl ...

Anyway, if you do already have the data you need, you could try xsl:key to group them more effectively. See this thread (a Muenchian method).

faster on the server

I'm not sure - best to check Symphony's ?profile view on that.

Thanks so far, juro. Sorry for being too imprecise. I've got a page that is called with a url-parameter "sort". Once I show projects sorted by name, once grouped by city and once grouped by year. This works so far well using the Muenchian method, only I thought it would be more elegant to do the grouping already in the data source. The xml output/group by only offers fields from the section used for the data source but it does not offer url-parameters. I thought if I can use url-parameters for filtering, why can't I use them for grouping?

Although you can't group by url parameters in a single datasource you could look to create more of a grouped output by data source chaining. So once the first datasource has run you can specify the output parameters the next datasource will use to filter on. This will allow a little more control of the output, filtering and consequent output to the XML of the page. I know it's not exactly the grouping you were looking for but it does provide an alternative option which can come in useful.

For real grouping control however this is best done in the XSLT and as @juro mentioned, the Muenchian method is probably one of the better ways.

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