Search

hello, This is my first website with Symphony and i enjoy it a lot! I'm facing a problem with filtering on data source, let me trying to explain what i want to do (sure is quite simple but don't know how to do this). I have two sections : one for the "categories" and one for the "content" itself. This sections are linked by the select box link and all work's as expected.

I would like to retrieve the last item from section "content" for each categories so i tried with an output parameters ( $ds-categories ) and it's for filtering but... i can't have only the last item for each categories, i always have all item's so the request is very important and increase the loading time.

If you have any ideas on how to accomplish that, i would be please to read your suggestions.

( sorry for my poor english ) Valéry

Well, what does last item mean for you?

For example in any section I'm adding an Order Entries field for sorting. This is its purpose. So, in my case last item can be either first item if I sort descending or last item if I'm sorting ascending in a Datasource.

Also, last item can be the item with closest date to present if you include a Date field in your section.

In both cases you've done ok with

I would like to retrieve the last item from section "content" for each categories so i tried with an output parameters ( $ds-categories ) and it's for filtering but ...

... but in your Content Datasource, you need to Sort By the field that denotes the order of your entries, then set Sort Order to be relevant (ascending or descending) and check Paginate results, limiting to 1 entries per page. Return page 1

Peace!

Thank's vladG,

In fact (and after a good night), i just need to do a request with a GROUP BY (like this :

SELECT DISTINCT A.relation_id, B.handle FROM sym_entries_data_42 A, sym_entries_data_75 B
WHERE A.entry_id = B.entry_id GROUP BY A.relation_id

) but this don't work as it would in ds interface so... i have to write a custom ds and it would be ok.

i'll try this and let you know if it's okay.

hum, just see that "group output" just group xml result, not sql.... understand why result isn't as expected!

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