I have a table created using Chronoforms with two key fields of information I want to use Chronoconnectivity to display in the frontend. Basically there is a GROUP field and an ITEM field. Each GROUP will have several entries in ITEM.
I want to display the data with a GROUP header rather than repeating the GROUP for each ITEM.
For example:
Group 1
Item 1
Item 2
Item 3
Group 2
Item 4
Item 5
Item 6
I'm assuming I need to use a Custom display. I currently have it configured to list the items. I need to know if and how I can get it to display the group headers.
I want to display the data with a GROUP header rather than repeating the GROUP for each ITEM.
For example:
Group 1
Item 1
Item 2
Item 3
Group 2
Item 4
Item 5
Item 6
I'm assuming I need to use a Custom display. I currently have it configured to list the items. I need to know if and how I can get it to display the group headers.
Maybe you can order by the group field, use a variable in the body area, set it to the group field value, but before this line, check if its current value matches the value of the group field in this row, if it doesn't then you need to display the group header, he is an example:
Regards,
Max
<?php
if($current_group != $row["Model"]["group_field"]){
//display the header of the group here
}
$current_group = $row["Model"]["group_field"]; // maybe you can move this line to the end of the body area if you like
Regards,
Max
This topic is locked and no more replies can be posted.
