Search

i have a list of products

 1. orange (fruit) 
 2. banana (fruit)
 3. orange (fruit)
 4. apple (fruit)
 5. milk (cow)
 6. cheese (cow)

each of them by a certain type (fruit or cow)

is there a way, to get a list like the one below, without grouping and frontend filtering with sql:DISTINCT or something else?

 1. orange (fruit)
 2. milk (cow)

thank you

I think not without a custom datasource.

Can you describe what you are actually trying to achieve?

@jensscherbl,

i have a section that holds products from various categories.

on my homepage i have a carousel that shoud be filled with latest products BUT if two of the latest products are of the same category, only one should be fetched;

so in the end the carousel will hold one new product of each category

Maybe the Datasource Multiplier could help here.. then you could place your SQL:DISTINCT statement inside each requesting filter possibly??

http://symphonyextensions.com/extensions/ds_multiplier/

You could then filter out each entry type and return one entry for each of the filters maybe?

so in the end the carousel will hold one new product of each category

A had exactly the same (or at least a quite similar) use case a while ago and wrote a custom datasource fot it.

I used the SymQL-extension for easier database queries, so you'll need to install this and then just drop the gist/datasource into your datasource folder and customize it to your needs.

Let me know if you need further help with the customizing.

I think the Data Source Multiplier-extension mentioned before does mostly the same and is a bit more convenient, but never used it myself and it's still labeled as experimental, so not sure about its reliability.

@jensscherbl, @moonoo2 i'll try 'em right now, and pick one thank you both :)

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