Friday, October 19, 2012

Drupal - Theming Views

http://pedroposada.com/blog/embed-views-2-nodes.html

methods available to a $view object:
http://drupalcontrib.org/api/drupal/contributions%21views%21includes%21view.inc/class/view/6

Registering template files in hook_theme():
        'views_view_table__map_requests__panel_pane_2' => array(
          'template' => 'views-view-table--map-requests--panel-pane-2',
          'path'  => drupal_get_path("module","maprequest") . '/themes',
        ),

Pass variables through to the template using:

function maprequest_theme_registry_alter (&$theme_registry) {
    {
    $tpl = $theme_registry['views_view_table'];
    $theme_registry['views_view_table__map_requests__panel_pane_2']['arguments'] = $tpl['arguments'];
    $theme_registry['views_view_table__map_requests__panel_pane_2']['preprocess functions'] = $tpl['preprocess functions'];
    } 
}

No comments:

Post a Comment