diff --git a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php index 290d1a7e190ff44f3c3a265800bd133905d62620..a45d39abd8fd1e6ded5768f7887db902996bc96b 100644 --- a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php +++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php @@ -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, ); } diff --git a/core/modules/views/templates/views-more.html.twig b/core/modules/views/templates/views-more.html.twig deleted file mode 100644 index b161a65ddcba8923f2ff726f9a6362507e79ba8f..0000000000000000000000000000000000000000 --- a/core/modules/views/templates/views-more.html.twig +++ /dev/null @@ -1,14 +0,0 @@ -{# -/** - * @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> diff --git a/core/modules/views/views.module b/core/modules/views/views.module index 25c62f8fe6ae593b24f5d5d250109c9531360c4a..9e9529e8c1918e4142cf94dd08d4c713e4ff7036 100644 --- a/core/modules/views/views.module +++ b/core/modules/views/views.module @@ -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(). *