Skip to content

Instantly share code, notes, and snippets.

View lkacenja's full-sized avatar

Leo Kacenjar lkacenja

  • Code for America
  • Denver, CO
View GitHub Profile
@lkacenja
lkacenja / gist:6887646
Created October 8, 2013 16:46
Adapted views-view-table template for Twig in Drupal 7. Approach would not be appropriate for D8 (or necessary).
<?php
// Preprocess
function minim_preprocess_views_view_table(&$variables) {
if (!empty($variables['header'])) {
$variables['headers_rendered'] = '';
foreach ($variables['header'] as $field => $label) {
$variables['headers_rendered'] .= "<th class='" . $variables['header_classes'][$field] . "'>" . $label . "</th>";
}
}
if (!empty($variables['rows'])) {