group by add element

prophoto

Active Member
I have two lists, one with a product category and a second one with its items. The item list has a dbjoin back to the category list.

When I have a custom list template setup copied from the div template with group by setup and all groups are set to collapse. So far so good, looks great! The structure is just like the Joomla articles and categories and I want to show the 'category description' just under the 'category title'. But in this case the category title is the group by heading in the list template and the description field is a separate element in the categories list.

So it would look like this when group by is open.

> Category Title 1
> Category Title 2
--category description--
item 1 item 2 item 3 item4
> Category Title 3
> Category Title 4

Can I use $group ask my pk to query the description element from the db?
 
The only way I can think of which might work would be to have a cascading dropdown on the items, which watches the category join, also joins to the categories table, and uses the description as the label. Or a calc which grabs the description with a query. And use that as the group by description.

-- hugh
 
Got it to work....used your suggestion with CDD/join. Then in div template used code below.

PHP:
<div class="groupdataMsg">
            <div class="emptyDataMessage" style="<?php echo $this->emptyStyle?>">
                         <?php echo $this->emptyDataMessage; ?>
             </div>
            <div class="groupDescription">
                         <?php echo $group[0]->data->categorylist___description;?>
            </div>
</div>
 
Well if you'd have said you didn't know it was there I'd have told you. :)

Sent from my HTC One using Tapatalk
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top