hook_views_tables

Events happening in the community are now at Drupal community events on www.drupal.org.
somebodysysop's picture

'extra' field in hook_views_data()?

In hook_views_tables, I used the 'extra' field to make sure that when my table was used in a view,it ony used records which matched the current group. i.e.:

<?php
  $tables
['og_users_roles'] = array(
   
'name' => 'og_users_roles',
   
'provider' => 'internal', // won't show up in external list.
   
'join' => array(
     
'left' => array(
       
'table' => 'node',
       
'field' => 'uid'
     
),
     
'right' => array(
       
'field' => 'uid'
     
),
     
'extra' => array(
       
'gid' => '<strong><em>CURRENT_GID</em></strong>'
     
),
    ),
?>
Read more
Subscribe with RSS Syndicate content