/ Published in: PHP
                    
                                        
This snippet searches a subfolder at views/default_views for any files with a .inc extension.  Place exported views code in a file in views/default_views to have it picked up and included by the function.  This eliminates the mess of trying to keep several long exported views in a single file.
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
/**
* Implements hook_views_default_views().
*/
function mymodule_views_default_views() {
$path = drupal_get_path('module', 'mymodule') .'/views/default_views';
include($filepath);
$views[$view->name] = $view;
}
return $views;
}
Comments
 Subscribe to comments
                    Subscribe to comments
                
                