diff --git a/config/sync/views.view.site_search.yml b/config/sync/views.view.site_search.yml index aa3d0d95..798ff0d2 100644 --- a/config/sync/views.view.site_search.yml +++ b/config/sync/views.view.site_search.yml @@ -2543,6 +2543,17 @@ display: plugin_id: result empty: false content: '
Displaying @start - @end of @total results.
' + area_text_custom: + id: area_text_custom + table: views + field: area_text_custom + relationship: none + group_type: group + admin_label: 'Message about "more search results are available if you log in".' + plugin_id: text_custom + empty: true + content: "[global:bc_dc_more_results_if_logged_in]
\r\n" + tokenize: true footer: { } display_extenders: { } cache_metadata: diff --git a/html/modules/custom/bc_dc/bc_dc.tokens.inc b/html/modules/custom/bc_dc/bc_dc.tokens.inc index c48b617f..d6012edc 100644 --- a/html/modules/custom/bc_dc/bc_dc.tokens.inc +++ b/html/modules/custom/bc_dc/bc_dc.tokens.inc @@ -30,6 +30,11 @@ function bc_dc_token_info() { 'description' => t('Returns the current plus the child terms for a uuid concatentated with +.'), ]; + $tokens['global']['bc_dc_more_results_if_logged_in'] = [ + 'name' => t('Message: Log in for more search results'), + 'description' => t("Provides a message only for anonymous users, letting them know that they'll see more search results if they log in."), + ]; + return ['types' => $types, 'tokens' => $tokens]; } @@ -80,6 +85,12 @@ function bc_dc_tokens($type, $tokens, array $data, array $options, BubbleableMet $replacements[$original] = implode('+', $results); } break; + + case 'bc_dc_more_results_if_logged_in': + $replacements[$original] = \Drupal::currentUser()->isAuthenticated() + ? '' + : 'To access to more records based on your credentials, please consider logging in.'; + break; } } }