commit e36c01434de5962019047522bebd4301a0916657 Author: Joel Pittet Date: Mon Apr 15 09:39:45 2013 -0700 removing markup from preprocess diff --git a/core/modules/views/templates/views-view-list.html.twig b/core/modules/views/templates/views-view-list.html.twig index c47183a..f6291b8 100644 --- a/core/modules/views/templates/views-view-list.html.twig +++ b/core/modules/views/templates/views-view-list.html.twig @@ -4,24 +4,30 @@ * Default theme implementation for a view template to display a list of rows. * * Available variables: - * - title: The title of this group of rows. May be empty. - * - list_type_prefix: will either be ul or ol. - * - list_type_suffix: will either be ul or ol. + * - rows: A list of rows for this list. + * - row_classes: The row's HTML attributes correlating with the row's 'id'. + * - title: The title of this group of rows. May be empty. + * - list: @todo. + * - type: Starting tag will be either a ul or ol. + * - attributes: HTML attributes for the list element. * * @see template_preprocess() * @see template_preprocess_views_view_list() * * @ingroup themeable - * @ingroup views_templates */ #} -{{ wrapper_prefix }} +{% if wrapper_attributes -%} + +{% endif %} {% if title %}

{{ title }}

{% endif %} - {{ list_type_prefix }} + <{{ list.type }}{{ list.attributes }}> {% for id,row in rows %} -
  • {{ row }}
  • + {{ row }} {% endfor %} - {{ list_type_suffix }} -{{ wrapper_suffix }} + +{% if wrapper_attributes -%} + +{% endif %} diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc index 3624528..b2eccda 100644 --- a/core/modules/views/views.theme.inc +++ b/core/modules/views/views.theme.inc @@ -828,7 +828,13 @@ function template_preprocess_views_view_unformatted(&$vars) { } /** - * Display the view as an HTML list element + * Prepares variables for Views HTML list templates. + * + * Default template: views-view-list.html.twig. + * + * @param array $variables + * An associative array containing: + * - view: A View object. */ function template_preprocess_views_view_list(&$variables) { $handler = $variables['view']->style_plugin; @@ -841,18 +847,14 @@ function template_preprocess_views_view_list(&$variables) { $wrapper_class = explode(' ', $handler->options['wrapper_class']); $wrapper_class = array_map('drupal_clean_css_identifier', $wrapper_class); - // Initialize a new attribute class for $class. - $attributes = new Attribute(array('class' => $class)); - // Initialize a new attribute class for $wrapper_class. if ($wrapper_class) { - $wrapper_class = new Attribute(array('class' => $wrapper_class)); - $variables['wrapper_prefix'] = ''; - $variables['wrapper_suffix'] = ''; + $variables['wrapper_attributes'] = new Attribute(array('class' => $wrapper_class)); } - $variables['list_type_prefix'] = '<' . $handler->options['type'] . $attributes . '>'; - $variables['list_type_suffix'] = 'options['type'] . '>'; + // Initialize a new attribute class for $class. + $variables['list']['attributes'] = new Attribute(array('class' => $class)); + $variables['list']['type'] = $handler->options['type']; template_preprocess_views_view_unformatted($variables); }