alter drupal 7 view query -


i want access 2 more columns want change view query, using following code not changing @ all, created own module , used this.

function aaa_views_api() { // module name hook_views_api   return array(     'api' => 3,         'path' => drupal_get_path('module', 'aaa'),   ); }   function jobs_views_query_alter(&$view, &$query) {   if ($view->name == 'view_name') {    drupal_set_message("i in");         $view->build_info['query'] = "select a,b,c tbl";   } } 

for starters if want modify query need modify $query object.

also hook function name in example aaa_views_query_alter()

you try following example http://tylerfrankenstein.com/code/drupal-7-how-modify-views-query-custom-module


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -