From 68803482334bbf94e540447d056d52d205ed8a6c Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Fri, 24 May 2013 10:25:24 -0700 Subject: [PATCH] Issue #1843770 by joelpittet, izus: Convert views/templates/views-view-unformatted.tpl.php to twig. --- .../views-view-unformatted.html.twig | 24 +++++++++++++++++++ .../templates/views-view-unformatted.tpl.php | 17 ------------- core/modules/views/views.theme.inc | 19 ++++++++++----- 3 files changed, 37 insertions(+), 23 deletions(-) create mode 100644 core/modules/views/templates/views-view-unformatted.html.twig delete mode 100644 core/modules/views/templates/views-view-unformatted.tpl.php diff --git a/core/modules/views/templates/views-view-unformatted.html.twig b/core/modules/views/templates/views-view-unformatted.html.twig new file mode 100644 index 000000000000..47a66cf7ce68 --- /dev/null +++ b/core/modules/views/templates/views-view-unformatted.html.twig @@ -0,0 +1,24 @@ +{# +/** + * @file + * Default theme implementation to display a view of unformatted rows. + * + * Available variables: + * - title: The title of this group of rows. May be empty. + * - rows: A list of the view's row items. + * - row_classes: A list of row class attributes keyed by the row's ID. + * + * @see template_preprocess() + * @see template_preprocess_views_view_unformatted() + * + * @ingroup themeable + */ +#} +{% if title %} +

{{ title }}

+{% endif %} +{% for id, row in rows %} + + {{ row }} + +{% endfor %} diff --git a/core/modules/views/templates/views-view-unformatted.tpl.php b/core/modules/views/templates/views-view-unformatted.tpl.php deleted file mode 100644 index b7f63b9b77ec..000000000000 --- a/core/modules/views/templates/views-view-unformatted.tpl.php +++ /dev/null @@ -1,17 +0,0 @@ - - -

- - $row): ?> -
> - -
- diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc index 4c3cab8e63cb..7f13ad8bfcf9 100644 --- a/core/modules/views/views.theme.inc +++ b/core/modules/views/views.theme.inc @@ -782,7 +782,14 @@ function template_preprocess_views_view_grid(&$vars) { } /** - * Display the simple view of rows one after another + * Prepares variables for views unformatted rows templates. + * + * Default template: views-view-unformatted.html.twig. + * + * @param array $vars + * An associative array containing: + * - view: The view object. + * - rows: An array of row items. Each row is an array of content. */ function template_preprocess_views_view_unformatted(&$vars) { $view = $vars['view']; @@ -1108,7 +1115,7 @@ function theme_views_mini_pager($vars) { * example, arguments which provide a summary view might change the style to * one of the special summary styles. * - * The default style for all views is views-view-unformatted.tpl.php + * The default style for all views is views-view-unformatted.html.twig. * * Many styles will then farm out the actual display of each row to a row * style; the default row style is views-view-fields.tpl.php. @@ -1123,10 +1130,10 @@ function theme_views_mini_pager($vars) { * - views-view--foobar.tpl.php * - views-view.tpl.php * - * - views-view-unformatted--foobar--page.tpl.php - * - views-view-unformatted--page.tpl.php - * - views-view-unformatted--foobar.tpl.php - * - views-view-unformatted.tpl.php + * - views-view-unformatted--foobar--page.html.twig + * - views-view-unformatted--page.html.twig + * - views-view-unformatted--foobar.html.twig + * - views-view-unformatted.html.twig * * - views-view-fields--foobar--page.tpl.php * - views-view-fields--page.tpl.php