Issue #2036195 by rteijeiro, m1r1k, _nolocation, andypost, joelpittet, akalata, haasontwerp: Remove views-more.html.twig and replace with #type link render arrays
parent
0fa529e4f0
commit
fc9df882bc
|
@ -2100,12 +2100,11 @@ abstract class DisplayPluginBase extends PluginBase implements DisplayPluginInte
|
|||
$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,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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>
|
|
@ -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().
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue