diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module index a61d27b..9747e61 100644 --- a/core/modules/forum/forum.module +++ b/core/modules/forum/forum.module @@ -491,17 +491,6 @@ function forum_theme_suggestions_forums(array $variables) { } /** - * Implements hook_preprocess_HOOK(). - */ -function forum_preprocess_views_view(&$variables) { - $view = $variables['view']; - if ($view->storage->id() == 'forum_topic_lists') { - // Append some descriptive text to provide context to the 'Read More' link. - $variables['more']['#link_title'] = $view->getTitle(); - } -} - -/** * Prepares variables for forums templates. * * Default template: forums.html.twig. diff --git a/core/modules/forum/forum.views_execution.inc b/core/modules/forum/forum.views_execution.inc index e69de29..d91bac7 100644 --- a/core/modules/forum/forum.views_execution.inc +++ b/core/modules/forum/forum.views_execution.inc @@ -0,0 +1,18 @@ +storage->id() == 'forum_topic_lists') { + // Append some descriptive text to provide context to the 'Read More' link. + $variables['more']['#link_title'] = $view->getTitle(); + } +} diff --git a/core/modules/views/templates/views-more.html.twig b/core/modules/views/templates/views-more.html.twig index b161a65..c785d6b 100644 --- a/core/modules/views/templates/views-more.html.twig +++ b/core/modules/views/templates/views-more.html.twig @@ -7,8 +7,9 @@ * - view: The view object. * - more_url: The URL for the views "more" link. * - link_text: The text for the views "more" link. + * - attributes: HTML attributes for the containing element. * * @ingroup themeable */ #} -{{ link_text }} +{{ link_text }} diff --git a/core/modules/views/views.module b/core/modules/views/views.module index 3294836..b1ea551 100644 --- a/core/modules/views/views.module +++ b/core/modules/views/views.module @@ -16,6 +16,7 @@ use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Render\Element; use Drupal\Core\Routing\RouteMatchInterface; +use Drupal\Core\Template\Attribute; use Drupal\views\Plugin\Derivative\ViewsLocalTask; use Drupal\Core\Template\AttributeArray; use Drupal\views\ViewExecutable; @@ -268,6 +269,13 @@ function views_theme_suggestions_node_alter(array &$suggestions, array $variable } /** + * Implements MODULE_preprocess_HOOK() for views-more templates. + */ +function views_preprocess_views_more(&$variables) { + $variables['attributes'] = new Attribute(); +} + +/** * A theme preprocess function to automatically allow view-based node * templates if called from a view. */