I'd like to list all the content posted by the current user's subusers defined by the Subuser module. (The teacher wants to see al his students' content). Using Drupal 6.x and Views 2.x
(The subuser module does not support this, and could not achieve this even with Table Wizard.)
The subuser_relationship table is very straightforward:
* rid // primary key
* parent_id // parent user id
* uid // child uid
Can you help me how to write the necessary mymodule_hook_views_data() function for Views in my module?
This is what I wrote so far, but unsure if it is correct:
$data['subuser_relationship']['table']['join'] = array(
'node' => array(
'field' => 'uid',
'left_table' => 'node',
'left_field' => 'uid',
),
'node' => array(
'field' => 'nid',
'left_table' => 'node',
'left_field' => 'nid',
)
);
I read many topics and Views documentation, but I did not find the detailed information about what to write into this $data array..
Comments
half complete :-)
I just found that I only had to add the table relationship into the module like this:
This helped me to join it to my query. This table has a field introduced this way:
I read the Views doc over and over but do not understand how to enable filtering this parent_id to be equal to the current user id. Can I put multiple filter entries on this field?