You're a bit off the mark here...
The Legend group is ONLY a back-end function and the TL_DCA is not available in the front-end template level in any TL application. Legend groups in the FE is rather pointless, because the BE field-set might only be useful for data entry, but not useful for displaying the data in the FE. The FE can also have each LIST type and READER type modules have fields in a completely different order, so then a group where the order has been changed becomes meaningless and some legend groups may not even have fields being displayed (as they are for BE capture only, e.g. published, start, stop fields are not displayed but used for query instead).
The easiest thing is to simply create your own manual groups in the template for the sections in code below:
Code:
<?php $groupnames = array ('field1'=>'My Group One', 'field5'=>'My Group Two'); ?>
<div class="field <?php echo $field; ?>">
<?php if (array_key_exists($field, $groupnames)): ?>
<div class="group"><?php echo $groupnames[$field]; ?></div>
<?php endif;?>
<div class="label"><?php echo $data['label']; ?></div>
<div class="value"><?php echo $data['value']; ?></div>
</div>
The field1 and field5 are the places where you would create your group breaks (before), You can just replace the titles with the correct ones, and then add more.
Since you only ever have to do this once, when you've completed the database's field definitions, then you're set for that website. No need to go and write out complicated code to read it, assign it to a varible in the template and then go and read it out from the template.
Bookmarks