This is a 2 part post, that shows how I exposed a legacy table to views in drupal and used the incredible power of views to create many combinations static and conditional views. This was very helpful for my client. I had a requirement that warranted exposing existing database table to views, so that views can contain data from this table. To enable this to happen, the following steps need to be taken. In a custom module you need to first define the views_api hook as following: function candidate_views_api(){ $view = array (); $view = array ( 'api' => 2 , 'path' => drupal_get_path( 'module' , 'candidate' ). '/views' ); return $view ; } candidate module was a custom module which I already had, so it made sense to add this hook here. The important bit here is telling the drupal sub-system where the views file will reside. ...
Comments
Post a Comment