This is not the 'obvious' order, and you can't add labels to these actions so please take care with this step.
Getting the User data
On the General tab:
- Set the Table to #__users (where #_ with be the prefix for your site).
- Set the Model ID to User
- Add name in the Fields box
On the Advanced tab
- Set Load Data to No
- Set Enable Associations to No (it will be Yes on the main action)
- Set the JOIN rule to link the two tables. Note that this includes the Model IDs as prefixes to the created_by and id column names.
-
`Articles`.`created_by` = `User`.`id`
- Add Articles in the Associated Models box
Getting the Article data
- Set the Table to #__content (where #_ with be the prefix for your site).
- Set the Model ID to Articles
- Add title in the Fields box
On the Advanced tab
- Set Load Data to Yes
- Set Enable Associations to Yes
- Leave the JOIN Rule empty
- Add User in the Associated Models box
- Set Group Model Data to No
On the Data Displayer tab
- Set Enable Data Displayer to Yes
- Add the columns and titles to display in the Display Fields box
-
title:Title,User.name:Author

Note that the DB Multi Record Loader listing is independent of the Show HTML action. If you want to show the listing together with a form then you can place the Show HTML action either before or after the main DB Multi-Record Loader action to set the way they will display on the page.
Creating a flat table
$form->data['Articles']
'title' => 'Some title'
'User' =>
'Name' => 'Some name'
'title' => 'Some other title'
'User' =>
'Name' => 'Some other name'
<?php
foreach ( $form->data['Articles'] as $k => $v ) {
foreach ( $v['User'] as $kk => $vv ) {
$form->data['Articles'][$k][$kk] = $v['User'][$kk];
}
unset($form->data['Articles'][$k]['User']);
}
?>
Note that if you use this AND you want to display the data then you should leave out any Model IDs from the 'Display Fields' box on the Data Displayer tab.

Comments