commit 375cde98a41dd24fc98ac8fd72f6e442a0de0df2 Author: Joel Pittet Date: Tue Sep 1 14:09:20 2015 -0700 remove theme diff --git a/core/modules/views/templates/views-view-field.html.twig b/core/modules/views/templates/views-view-field.html.twig index 04a20ac..a058548 100644 --- a/core/modules/views/templates/views-view-field.html.twig +++ b/core/modules/views/templates/views-view-field.html.twig @@ -3,6 +3,10 @@ * @file * Default theme implementation for a single field in a view. * + * It is not actually used in default views, as this is registered as a theme + * function which has better performance. For single overrides, the template is + * perfectly okay. + * * Available variables: * - view: The view that the field belongs to. * - field: The field handler that can process the input. @@ -20,4 +24,4 @@ * @ingroup themeable */ #} -{{ output -}} +{{ output }} diff --git a/core/modules/views/views.module b/core/modules/views/views.module index 6d811e5..22424a1 100644 --- a/core/modules/views/views.module +++ b/core/modules/views/views.module @@ -133,6 +133,7 @@ function views_theme($existing, $type, $theme, $path) { // Default view themes $hooks['views_view_field'] = $base + array( 'variables' => array('view' => NULL, 'field' => NULL, 'row' => NULL), + 'function' => 'theme_views_view_field', ); $hooks['views_view_grouping'] = $base + array( 'variables' => array('view' => NULL, 'grouping' => NULL, 'grouping_level' => NULL, 'rows' => NULL, 'title' => NULL), diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc index a6a5f8b..f34d076 100644 --- a/core/modules/views/views.theme.inc +++ b/core/modules/views/views.theme.inc @@ -250,6 +250,19 @@ function template_preprocess_views_view_grouping(&$variables) { } /** + * Display a single views field. + * + * Interesting bits of info: + * $field->field_alias says what the raw value in $row will be. Reach it like + * this: @code { $row->{$field->field_alias} @endcode + * + * @ingroup themeable + */ +function theme_views_view_field($variables) { + return $variables['output']; +} + +/** * Prepares variables for views field templates. * * Default template: views-view-field.html.twig.