1 year ago


didn't anyone here ever need a seb_blog template where you can GROUP items according to a field ?

the need is to display events grouped by months. The end result would be


event1 event2 event3


event4 event5 event6


event7 event8 event9

and so on

so far we used lists within lists but it's a bit heavy 

thanks for sharing


Get a VIP membership
1 year ago
Level 1

I must add I first tried with a free query:

SELECT group_concat(ct.title),ev.ev_event_month FROM #__content as ct INNER JOIN #__cck_store_form_event as ev ON (ct.id=ev.id) WHERE ct.catid=31 GROUP BY ev.ev_event_month

but then the list result does not display the group_concat(ct.title) !

208 Posts
11 months ago
Level 2

Hi Cyril

MySQL GroupConcat function can be an option for this, but I am not sure if the best one. In order to make it work you have to 

1) Add the alias to the result e.g. group_concat(...) AS event_data

2) Create a free sotrage (no table selected) field called event_data

3) You have to explode the output in php using explode() function to get an array

What to watch out for

1) Use a good separator in groupconcat function, not just comma, if the concatenate data are strings. the best is to use some asci character

2) The default maximum length of groupconcat function output string is 1024, in case you have larger output, you have to extend it somehow.

Good Luck


Get a VIP membership