Commit fc9df882 authored by webchick's avatar webchick

Issue #2036195 by rteijeiro, m1r1k, _nolocation, andypost, joelpittet,...

Issue #2036195 by rteijeiro, m1r1k, _nolocation, andypost, joelpittet, akalata, haasontwerp: Remove views-more.html.twig and replace with #type link render arrays
parent 0fa529e4
......@@ -2100,12 +2100,11 @@ public function renderMoreLink() {
$url_options['query'] = $this->view->exposed_raw_input;
}
$url->setOptions($url_options);
$theme = $this->view->buildThemeFunctions('views_more');
return array(
'#theme' => $theme,
'#more_url' => $url->toString(),
'#link_text' => SafeMarkup::checkPlain($this->useMoreText()),
'#type' => 'more_link',
'#url' => $url,
'#title' => $this->useMoreText(),
'#view' => $this->view,
);
}
......
{#
/**
* @file
* Default theme implementation for a views "more" link.
*
* Available variables:
* - view: The view object.
* - more_url: The URL for the views "more" link.
* - link_text: The text for the views "more" link.
*
* @ingroup themeable
*/
#}
<a href="{{ more_url }}" class="more-link">{{ link_text }}</a>
......@@ -209,10 +209,6 @@ function views_theme($existing, $type, $theme, $path) {
'render element' => 'form',
);
$hooks['views_more'] = $base + array(
'variables' => array('more_url' => NULL, 'link_text' => 'more', 'view' => NULL),
);
return $hooks;
}
......@@ -278,6 +274,15 @@ function views_theme_suggestions_comment_alter(array &$suggestions, array $varia
}
}
/**
* Implements hook_theme_suggestions_HOOK_alter().
*/
function views_theme_suggestions_container_alter(array &$suggestions, array $variables) {
if (!empty($variables['element']['#type']) && $variables['element']['#type'] == 'more_link' && !empty($variables['element']['#view']) && $variables['element']['#view'] instanceof \Drupal\views\ViewExecutable) {
$suggestions = array_merge($suggestions, $variables['element']['#view']->buildThemeFunctions('container__more_link'));
}
}
/**
* Implements hook_element_info_alter().
*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment